blob: 1b89e59993b77b00f7dc7057dbf3c6c344aaec6c [file] [log] [blame]
/*
* Some or all of this work - Copyright (c) 2006 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
//
// Grammar.asl - Minimally excercises most ASL constructs
//
// NOTE -- use: iasl -f -of grammar.asl to compile
//
// This 1) Ignores errors (checks compiler error handling)
// 2) Disables constant folding
//
//
/*******************************************************************************
Compilation should look like this:
C:\acpica\tests\misc>iasl -f -of grammar.asl
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20090422 [Apr 22 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 3.0a
grammar.asl 187: Name (_NPK, Package (8)
Warning 1098 - ^ Unknown reserved name (_NPK)
grammar.asl 510: NAME (ESC1, "abcdefg\x00hijklmn")
Warning 1042 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
grammar.asl 511: NAME (ESC2, "abcdefg\000hijklmn")
Warning 1042 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
grammar.asl 601: Method (RCIV, 1)
Warning 1087 - ^ Not all control paths return a value (RCIV)
grammar.asl 608: RCIV (Subtract (Arg0, 1))
Remark 5073 - ^ Recursive method call (RCIV)
grammar.asl 937: Method (_ERR, 2)
Warning 1077 - ^ Reserved method has too few arguments (_ERR requires 3)
grammar.asl 1377: Store (0x1234567887654321, QWD2)
Warning 1032 - ^ 64-bit integer in 32-bit table, truncating
grammar.asl 1379: if (LNotEqual (Local0, 0x1234567887654321))
Warning 1032 - 64-bit integer in 32-bit table, truncating ^
grammar.asl 1459: SizeOf (BUFO)
Warning 1105 - ^ Result is not used, operator has no effect
grammar.asl 1485: Acquire (MTX2, 1)
Warning 1104 - ^ Possible operator timeout is ignored
grammar.asl 1633: Add (Local0, Local1)
Warning 1105 - ^ Result is not used, operator has no effect
grammar.asl 1804: Method (COND)
Warning 1087 - ^ Not all control paths return a value (COND)
grammar.asl 6010: Name (_HID, "*PNP0A06")
Error 4001 - ^ String must be entirely alphanumeric (*PNP0A06)
grammar.asl 6461: Name (_CRS, Buffer(26) {"\_SB_.PCI2._CRS..........."})
Warning 1038 - Invalid or unknown escape sequence ^
grammar.asl 6800: And (Local0, 1, Local0) // Local0 &= 1
Error 4050 - ^ Method local variable is not initialized (Local0)
grammar.asl 6886: Name (_HID, "*PNP0C0A") // Control Method Battey ID
Error 4001 - ^ String must be entirely alphanumeric (*PNP0C0A)
ASL Input: grammar.asl - 10254 lines, 322162 bytes, 4810 keywords
AML Output: grammar.aml - 43392 bytes, 669 named objects, 4141 executable opcodes
Compilation complete. 3 Errors, 12 Warnings, 1 Remarks, 1101 Optimizations
***************************************************************************************************/
DefinitionBlock (
"grammar.aml", //Output filename
"DSDT", //Signature
0x01, //DSDT Revision ---> 32-bit table
"Intel", //OEMID
"GRMTEST", //TABLE ID
0x20090511 //OEM Revision
)
{
External (\ABCD, UnknownObj)
/* Device with _STA and _INI */
Device (A1)
{
Method (_STA)
{
Return (0x0F)
}
Method (_INI)
{
Return
}
}
/* Device with no _STA, has _INI */
Device (A2)
{
Method (_INI)
{
Return
}
}
/* Device with _STA, no _INI */
Device (A3)
{
Method (_STA)
{
Return (0x0F)
}
}
/* Device with _STA and _INI, but not present */
Device (A4)
{
Method (_STA)
{
Return (Zero)
}
Method (_INI)
{
Return
}
}
/* Resource descriptors */
Device (IRES)
{
Name (PRT0, ResourceTemplate ()
{
IRQ (Edge, ActiveHigh, Exclusive) {3,4,5,6,7,9,10,11,14,15}
StartDependentFn (1,1)
{
IRQNoFlags () {0,1,2}
}
EndDependentFn ()
})
Method (_CRS, 0, NotSerialized)
{
Store ("_CRS:", Debug)
Store (PRT0, Debug)
Return (PRT0)
}
Method (_SRS, 1, Serialized)
{
Store ("_SRS:", Debug)
Store (Arg0, Debug)
Return (Zero)
}
}
Name (_NPK, Package ()
{
0x1111,
0x2222,
0x3333,
0x4444
})
Device (RES)
{
Name (_PRT, Package (0x04)
{
Package (0x04)
{
0x0002FFFF,
Zero,
Zero,
Zero
},
Package (0x04)
{
0x0002FFFF,
One,
Zero,
Zero
},
Package (0x04)
{
0x000AFFFF,
Zero,
Zero,
Zero
},
Package (0x04)
{
0x000BFFFF,
Zero,
Zero,
Zero
}
})
Method (_CRS, 0, Serialized)
{
Name (PRT0, ResourceTemplate ()
{
WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
0x0000, // Address Space Granularity
0xFFF2, // Address Range Minimum
0xFFF3, // Address Range Maximum
0x0032, // Address Translation Offset
0x0002,,,)
WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
0x0000, // Address Space Granularity
0x0000, // Address Range Minimum
0x00FF, // Address Range Maximum
0x0000, // Address Translation Offset
0x0100,,,)
WordSpace (0xC3, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
0x0000, // Address Space Granularity
0xA000, // Address Range Minimum
0xBFFF, // Address Range Maximum
0x0000, // Address Translation Offset
0x2000,,,)
IO (Decode16, 0x0CF8, 0x0CFF, 0x01, 0x08)
WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000, // Address Space Granularity
0x0000, // Address Range Minimum
0x0CF7, // Address Range Maximum
0x0000, // Address Translation Offset
0x0CF8,,,
, TypeStatic)
WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000, // Address Space Granularity
0x0D00, // Address Range Minimum
0xFFFF, // Address Range Maximum
0x0000, // Address Translation Offset
0xF300,,,
, TypeStatic)
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x00000000, // Address Space Granularity
0x00000000, // Address Range Minimum
0x00000CF7, // Address Range Maximum
0x00000000, // Address Translation Offset
0x00000CF8,,,
, TypeStatic)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
0x00000000, // Address Space Granularity
0x000C8000, // Address Range Minimum
0x000EFFFF, // Address Range Maximum
0x00000000, // Address Translation Offset
0x00028000,,,
, AddressRangeMemory, TypeStatic)
DWordSpace (0xC3, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
0x00000000, // Address Space Granularity
0x000C8000, // Address Range Minimum
0x000EFFFF, // Address Range Maximum
0x00000000, // Address Translation Offset
0x00028000,,,)
QWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000000000000000, // Address Space Granularity
0x0000000000000000, // Address Range Minimum
0x0000000000000CF7, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x0000000000000CF8, 0x44, "This is a ResouceSource string",
, TypeStatic)
QWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000000000000000, // Address Space Granularity
0x0000000000000000, // Address Range Minimum
0x0000000000000CF7, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x0000000000000CF8,,,
, TypeStatic)
QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
0x0000000000000000, // Address Space Granularity
0x0000000000100000, // Address Range Minimum
0x00000000FFDFFFFF, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x00000000FFD00000,,,
, AddressRangeMemory, TypeStatic)
QWordSpace (0xC3, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
0x0000000000000000, // Address Space Granularity
0x0000000000000000, // Address Range Minimum
0x0000000000000CF7, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x0000000000000CF8,,,)
ExtendedIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000000000000000, // Address Space Granularity
0x0000000000000000, // Address Range Minimum
0x0000000000000CF7, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x0000000000000CF8, // Address Length
0x0000000000000000, // Type Specific Attributes
, TypeStatic)
ExtendedMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
0x0000000000000000, // Address Space Granularity
0x0000000000100000, // Address Range Minimum
0x00000000FFDFFFFF, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x00000000FFD00000, // Address Length
0x0000000000000000, // Type Specific Attributes
, AddressRangeMemory, TypeStatic)
ExtendedSpace (0xC3, ResourceProducer, PosDecode, MinFixed, MaxFixed, 0xA3,
0x0000000000000000, // Address Space Granularity
0x0000000000100000, // Address Range Minimum
0x00000000FFDFFFFF, // Address Range Maximum
0x0000000000000000, // Address Translation Offset
0x00000000FFD00000, // Address Length
0x0000000000000000) // Type Specific Attributes
IO (Decode16, 0x0010, 0x0020, 0x01, 0x10)
IO (Decode16, 0x0090, 0x00A0, 0x01, 0x10)
FixedIO (0x0061, 0x01)
IRQNoFlags () {2}
DMA (Compatibility, BusMaster, Transfer8_16) {4}
DMA (Compatibility, BusMaster, Transfer8) {2,5,7}
Memory32Fixed (ReadWrite, 0x00100000, 0x00000000)
Memory32Fixed (ReadOnly, 0xFFFE0000, 0x00020000)
Memory32 (ReadOnly, 0x00020000, 0xFFFE0000, 0x00000004, 0x00000200)
Memory24 (ReadOnly, 0x1111, 0x2222, 0x0004, 0x0200)
Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, 0xE, "\\_SB_.TEST")
{
0x00000E01,
}
Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, 0x6, "xxxx")
{
0x00000601,
0x00000003,
0x00000002,
0x00000001,
}
Interrupt (ResourceProducer, Edge, ActiveHigh, Exclusive)
{
0xFFFF0000,
0x00000003,
0x00000002,
0x00000001,
0x00000005,
0x00000007,
0x00000009,
}
VendorShort () {0x01, 0x02, 0x03}
VendorLong ()
{
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09
}
Register (SystemIO, 0x08, 0x00, 0x00000000000000B2, , R000)
Register (SystemMemory, 0x08, 0x00, 0x00000000000000B2)
StartDependentFnNoPri ()
{
IRQNoFlags () {0,1,2}
IRQ (Level, ActiveLow, Shared) {3,4,5,6,7,9,10,11,14,15}
}
EndDependentFn ()
})
CreateWordField (PRT0, 0x08, BMIN)
CreateByteField (PRT0, R000._ASZ, RSIZ)
Store (0x03, BMIN)
Return (PRT0)
}
Method (_PRS, 0, Serialized)
{
Name (BUF0, ResourceTemplate ()
{
StartDependentFn (0x01, 0x02)
{
IO (Decode16, 0x03D8, 0x03F8, 0x01, 0x08)
IRQNoFlags () {4}
}
StartDependentFn (0x02, 0x01)
{
IO (Decode16, 0x03D8, 0x03E8, 0x01, 0x08)
IRQNoFlags () {4}
}
StartDependentFn (0x00, 0x02)
{
IO (Decode16, 0x02E8, 0x02F8, 0x01, 0x08)
IRQNoFlags () {3}
}
StartDependentFn (0x00, 0x02)
{
IO (Decode16, 0x02D8, 0x02E8, 0x01, 0x08)
IRQNoFlags () {3}
}
StartDependentFn (0x02, 0x00)
{
IO (Decode16, 0x0100, 0x03F8, 0x08, 0x08)
IRQNoFlags () {1,3,4,5,6,7,8,10,11,12,13,14,15}
}
EndDependentFn ()
})
Return (BUF0)
}
Method (_SRS, 1, Serialized)
{
Return (Zero)
}
}
Name(\_S0,Package(0x04){
0x00,
0x00,
0x00,
0x00
})
Name(\_S3,Package(0x04){
0x05,
0x05,
0x00,
0x00
})
Name(\_S4,Package(0x04){
0x06,
0x06,
0x00,
0x00
})
Name(\_S5,Package(0x04){
0x07,
0x07,
0x00,
0x00
})
/* Examine this table header (DSDT) */
/*
DataTableRegion (HDR, "DSDT", "", "")
Field (HDR, AnyAcc, NoLock, Preserve)
{
SIG, 32,
LENG, 32,
REV, 8,
SUM, 8,
OID, 48,
OTID, 64,
OREV, 32,
CID, 32,
CREV, 32
}
Method (SIZE)
{
If (LLess (REV, 2))
{
Store ("32-bit table", Debug)
}
else
{
Store ("64-bit table", Debug)
}
Return (0)
}
*/
Name (SIZE, 0)
/* Custom operation region */
OperationRegion(MYOP,0x80,0xFD60,0x6)
Field(MYOP,ByteAcc,NoLock,Preserve)
{
MFLD,8
}
Method (TCOP,, Serialized)
{
Name (_STR, Unicode ("test"))
Store (4, MFLD)
Store (MFLD, Local0)
}
Name (ERRS, 0x0)
/* Warning should be issued for premature string termination */
NAME (ESC1, "abcdefg\x00hijklmn")
NAME (ESC2, "abcdefg\000hijklmn")
Name (ESC3, "abc\a\bdef\f\n\r\t\v\x03ffff\432")
Name(CRSA,ResourceTemplate()
{
WORDBusNumber(ResourceProducer,MinFixed,MaxFixed,PosDecode,0x0000,0x0019,0x001D,0x0000,0x0005)
WORDIO(ResourceProducer,MinFixed,MaxFixed,PosDecode,NonISAOnlyRanges,0x0000,0xC000,0xCFFF,0x0000,0x1000)
DWORDMemory(ResourceProducer,PosDecode,MinFixed,MaxFixed,NonCacheable,ReadWrite,0x00000000,0xD8000000,0xDBFFFFFF,0x00000000,0x04000000)
})
Name(CRSB,ResourceTemplate()
{
DWORDMemory(ResourceProducer,PosDecode,MinFixed,MaxFixed,NonCacheable,ReadWrite,0x00000000,0xD8000000,0xDBFFFFFF,0x00000000,0x04000000)
})
Name(CRSC,ResourceTemplate()
{
VendorShort () {0x1, 0x2, 0x3}
})
Name(CRSD,ResourceTemplate()
{
VendorLong (VNDL) {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9}
})
Name(CRSE,ResourceTemplate()
{
IRQNoFlags(){3,4,10,11}
IRQNoFlags(xxxt){3,4,10,11}
})
Name(CRSR, Buffer (Add (SizeOf(CRSA),SizeOf(CRSB))){})
Method(_CRS,0,NotSerialized)
{
Return(CRSR)
}
//
// Unnamed scope
//
Scope (\)
{
Name(Bxxx,0xFFFFFFFF)
}
Name (LANS, 0x0)
PowerResource(LANP,1,0)
{
Method(_STA){
If(LEqual(And(LANS,0x30),0x30)){
Return(One)
} Else {
Return(Zero)
}
}
Method(_ON){
If(LNot(_STA())){
Store (0x30, LANS)
}
}
Method(_OFF){
If(_STA()){
Store (0, LANS)
}
}
}
/* Can a method define another method? */
/**********************************
Method (TASK, 2, SERIALIZED)
{
Sleep (100)
Method (TAS2)
{
Sleep (100)
}
TAS2()
Return
}
************************************/
/* A recursive method */
Method (RCIV, 1)
{
Store (Arg0, Debug)
If (Lequal (Arg0, 0))
{
Return ()
}
RCIV (Subtract (Arg0, 1))
}
Method (RTOP)
{
RCIV (100)
}
Scope(\_PR)
{
Processor(CPU0,0x0,0xFFFFFFFF,0x0) {}
}
Name(B1TP,0xFFFFFFFF)
Name(B2TP,0xFFFFFFFF)
Name(ADPS,0xFFFFFFFF)
Name(B1PS,0xFFFFFFFF)
Name(B1RS,0xFFFFFFFF)
Name(B1CS,0xFFFFFFFF)
Name(B2PS,0xFFFFFFFF)
Name(B2RS,0xFFFFFFFF)
Name(B2CS,0xFFFFFFFF)
Name(B1DC,3000)
Name(B2DC,2600)
Name(B1LF,3000)
Name(B2LF,2600)
Name(BPIF,0)
Name(PBLL,0)
Name(RBIF,Package()
{
0x1,
2200,
2200,
0x1,
10800,
0,
0,
1,
1,
"CA54200-5003/5",
"1",
"LION",
"Fujitsu"
})
Method(SMWE, 4)
{
return(ONES)
}
Method(SMRE, 4)
{
return(ONES)
}
/*
Method(RDBT,0,Serialized){
If(LNot(SMWE(0x09,0x15,1,1))){
Store(0x18,Local2)
}
}
*/
Scope(_SB)
{
Name (SBUF, Buffer (128) {})
CreateBitField (SBUF, 3, BITY)
CreateByteField (SBUF, 1, BYTY)
CreateWordField (SBUF, 2, WRDZ)
CreateDwordField (SBUF, 4, DWDZ)
CreateQwordField (SBUF, 8, QWDZ)
CreateField (SBUF, 128, 12, FLDZ)
CreateField (SBUF, 148, 96, FLDY)
CreateField (SBUF, 148, 96, \_SB_.FLDW)
Method (_INI)
{
CreateField (\_SB_.SBUF, 148, 96, FLDV)
}
Device(PCI0)
{
Name(_HID,EISAID("PNP0A03"))
Name(_ADR,0x0)
Method(_CRS,, Serialized)
{
Name(PRT0, ResourceTemplate() {
WORDBusNumber( // Bus number resource(0)
ResourceConsumer, // bit 0 of general flags is 1
MinFixed, // Range is notfixed
MaxFixed, // Range is not fixed
SubDecode, // SubDecode
0x0000, // Granularity
0xfff1, // Min
0xfff2, // Max
0x0032, // Translation
0x0002,,, // Range Length
BUS0
) } )// PRT0
CreateWordField(PRT0, BUS0._MIN, BMIN) //Minimum bus number suported under this bridge.
Store(3, BMIN)
Return(PRT0)
} // _CRS
Method(_SRS)
{
Return ()
}
Device(EIO)
{
OperationRegion(FJIO,SystemIO,0xFD60,0x6)
Field(FJIO,ByteAcc,NoLock,Preserve)
{
GIDX,8,
GDTA,8,
PIDX,8,
PDTA,8,
SIDX,8,
SDTA,8
}
IndexField(GIDX,GDTA,ByteAcc,NoLock,Preserve)
{
Offset(0x2),
,5,
VGAS,2,
Offset(0x4),
,4,
DCKE,1,
Offset(0x5),
,6,
ACPW,1,
Offset(0xA),
B1P,1,
B2P,1,
B1C,1,
B2C,1,
B1ER,1,
B2ER,1,
Offset(0xB),
B1CP,8,
B2CP,8,
BCP,8,
B1VH,8,
B1VL,8,
B2VH,8,
B2VL,8,
B1TM,8,
B2TM,8,
B1CH,8,
B1CL,8,
B2CH,8,
B2CL,8
}
}
}
}
Method(RDBT,3,Serialized){
Store(0x1FFF,Local1)
If( Arg0 ){
Store(0x2FFF,Local1)
}
Store(0x18,Local2)
If( Arg1 ){
Store(0x10,Local2)
}
If(LNot(SMRE(0x09,0x15,1,RefOf(Local0)))){
If(LNot(SMWE(0x08,0x14,1,Local1))){
If(LNot(SMRE(0x09,0x17,Local2,RefOf(Local3)))){
Store(Local1,Arg2)
}
}
Or(Local0,0xFFF,Local0)
SMWE(0x08,0x14,1,Local0)
}
}
Method(MKWD,2)
{
If(And(Arg1,0x80)) {
Or(0xFFFF0000,Arg0,Local0)
Or(Local0,ShiftLeft(Arg1,8),Local0)
Subtract(Zero,Local0,Local0)
} else {
Store(Arg0,Local0)
Or(Local0,ShiftLeft(Arg1,8),Local0)
}
Return(Local0)
}
Device(CMB1)
{
Name(_HID,EISAID("PNP0C0A"))
Name(_UID,0x1)
Alias(\_SB.PCI0.EIO.B1P,\_SB_.PCI0.XXXX)
Alias(\_SB.PCI0.EIO.B1P,B1P)
Alias(\_SB.PCI0.EIO.B1C,B1C)
Alias(\_SB.PCI0.EIO.B1CH,B1CH)
Alias(\_SB.PCI0.EIO.B1CL,B1CL)
Alias(\_SB.PCI0.EIO.B1VH,B1VH)
Alias(\_SB.PCI0.EIO.B1VL,B1VL)
Alias(\_SB.PCI0.EIO.B1CP,B1CP)
Method(_INI)
{
Store(B1P, B1PS)
Store(B1CP,B1RS)
Store(B1C, B1CS)
}
Method(_BIF){
RDBT(Zero,Zero,RefOf(B1DC))
RDBT(Zero,One,RefOf(B1LF))
Store(B1DC,Index(RBIF,1))
Store(B1LF,Index(RBIF,2))
Store("CA54200-5003/5",Index(RBIF,9))
Store("1",Index(RBIF,10))
Return(RBIF)
}
Method(_BST,, Serialized) {
_INI()
Store(Zero,Local0)
if (LAnd(B1P,LNot(B1C))){
Or(Local0,1,Local0)
}
if (LAnd(B1P,B1C)) {
Or(Local0,2,Local0)
}
if (LLessEqual(B1CP,1)) {
Or(Local0,4,Local0)
}
Store(MKWD(B1CL,B1CH),Local1)
Store(Divide(Add(Multiply(B1CP,B1LF),99),100),Local2)
Store(MKWD(B1VL,B1VH),Local3)
Name(STAT,Package(4){})
Store(Local0,Index(STAT,0))
Store(Local1,Index(STAT,1))
Store(Local2,Index(STAT,2))
Store(Local3,Index(STAT,3))
If(LNot(BPIF)){
// \_SB.PCI0.EIO.EC0.IECT()
// \_SB.PCI0.EIO.EC0.SECT()
Store(One,BPIF)
}
return(STAT)
}
}
Device (DEV1)
{
}
Scope(\_TZ)
{
ThermalZone(TZ1)
{
Name(_PSL,Package()
{
\_PR.CPU0
})
}
}
Method (TZ2, 0, SERIALIZED)
{
Name(_PSL,Package()
{
\_PR.CPU0
})
Return (_PSL)
}
ThermalZone (THM1)
{
}
Method (NOTI)
{
Notify (\DEV1, 0)
Notify (\THM1, 0)
Notify (\_PR.CPU0, 0)
}
Method (_ERR, 2)
{
Increment (ERRS)
Store ("Run-time exception:", Debug)
Store (Arg0, Debug)
Store (Arg1, Debug)
Return (0) // Map error to AE_OK
}
Method (DIV0)
{
Store (1, Local0)
Store (0, Local1)
Divide (Local0, Local1, Local3)
Store ("DIV0 - noabort", Debug)
}
Method (ERR_, 1)
{
if (LEqual (Arg0, 0))
{
Store ("+*+*+*+* MTHD_ERROR: Results not equal!", Debug)
}
if (LEqual (Arg0, 1))
{
Store ("+*+*+*+* MTHD_ERROR: Numeric result is incorrect!", Debug)
}
if (LEqual (Arg0, 2))
{
Store ("+*+*+*+* MTHD_ERROR: Operand was clobbered!", Debug)
}
Notify (DEV1, Arg0)
Increment (ERRS)
}
Method (R226, 2)
{
}
Method (R225, 2)
{
R226 (Arg0, Arg1)
}
Method (R224, 2)
{
R225 (Arg1, Arg0)
}
Method (R223, 2)
{
R224 (Arg0, Arg1)
}
Method (R222, 2)
{
R223 (Arg1, Arg0)
}
Method (R111)
{
Store (0x01010101, Local0)
R222 (0xABAB, Local0)
Store (Local0, Local1)
}
Method (MAIN)
{
// SIZE()
Store (NUM1(), Local0)
\CMB1._BST()
RDBT(1,2,3)
OBJ1(1)
OBJ2(2)
CHEK()
RETZ()
BITZ()
LOGS()
REFS()
COND()
TZ2()
//
// iPCO tests added
//
Store (\IFEL.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\NOSV.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\IDXF.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.NSTL.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\RTBF.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.RTLV.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.RETP.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\WHLR.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\ANDO.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\BRKP.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\ADSU.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\INDC.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\LOPS.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\FDSO.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\MLDV.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\NBIT.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\SHFT.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\XORD.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\CRBF.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\IDX4.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\EVNT.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\SZLV.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.BYTF.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\DWDF.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\DVAX.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\IDX6.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\IDX5.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.IDX0.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.IDX3.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\IDX7.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\MTCH.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\WHLB.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.IDX2.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\SIZO.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
Store (\_SB_.SMIS.TEST(), Local0)
if (LGreater (Local0, 0))
{
ERR_ (1)
Return(Local0)
}
if (LGreater (ERRS, 0))
{
Store ("****** There were errors during the execution of the test ******", Debug)
}
// Flush all notifies
Sleep (250)
//
// Last Test
//
Return(0) // Success
}
Method (OBJ1, 1, SERIALIZED)
{
Store (3, Local0)
Name(BUFR, Buffer (Local0) {})
Name(BUF1, Buffer (4) {1,2,3,4})
Name(BUF2, Buffer (4) {})
Store (BUF1, BUF2)
Mutex (MTX1, 4)
Alias (MTX1, MTX2)
}
Mutex (MTXT, 0)
Mutex (MTXX, 0)
/*
* Field Creation
*/
Method (FLDS,, Serialized)
{
Store ("++++++++ Creating BufferFields", Debug)
Name (BUF2, Buffer (128) {})
CreateBitField (BUF2, 3, BIT2)
CreateByteField (BUF2, 1, BYT2)
CreateWordField (BUF2, 2, WRD2)
CreateDwordField (BUF2, 4, DWD2)
CreateQwordField (BUF2, 8, QWD2)
CreateField (BUF2, 128, 12, FLD2)
CreateField (BUF2, 148, 96, FLD3)
Store (0x1, BIT2)
Store (BIT2, Local0)
if (LNotEqual (Local0, 0x1))
{
ERR_ (1)
}
else
{
Store (DerefOf (Index (BUF2, 0)), Local0)
if (LNotEqual (Local0, 0x08))
{
ERR_ (1)
}
else
{
Store ("++++++++ Bit BufferField I/O PASS", Debug)
}
}
Store (0x1A, BYT2)
Store (BYT2, Local0)
if (LNotEqual (Local0, 0x1A))
{
ERR_ (1)
}
else
{
Store ("++++++++ Byte BufferField I/O PASS", Debug)
}
Store (0x1234, WRD2)
Store (WRD2, Local0)
if (LNotEqual (Local0, 0x1234))
{
ERR_ (1)
}
else
{
Store ("++++++++ Word BufferField I/O PASS", Debug)
}
Store (0x123, FLD2)
Store (FLD2, Local0)
if (LNotEqual (Local0, 0x123))
{
ERR_ (1)
}
else
{
Store ("++++++++ 12-bit BufferField I/O PASS", Debug)
}
Store (0x12345678, DWD2)
Store (DWD2, Local0)
if (LNotEqual (Local0, 0x12345678))
{
ERR_ (1)
}
else
{
Store ("++++++++ Dword BufferField I/O PASS", Debug)
}
Store (0x1234567887654321, QWD2)
Store (QWD2, Local0)
if (LNotEqual (Local0, 0x1234567887654321))
{
ERR_ (1)
}
else
{
Store ("++++++++ Qword BufferField I/O PASS", Debug)
}
}
/* Field execution */
Method (FLDX,, Serialized)
{
Field (\_SB_.MEM.SMEM, AnyAcc, NoLock, Preserve)
{ // Field: SMEM overlay using 32-bit field elements
SMD0, 32, // 32-bits
SMD1, 32, // 32-bits
SMD2, 32, // 32-bits
SMD3, 32 // 32-bits
} // Field: SMEM overlay using 32-bit field elements
Field (\_SB_.MEM.SMEM, AnyAcc, NoLock, Preserve)
{ // Field: SMEM overlay using greater than 32-bit field elements
SME0, 69, // larger than an integer (32 or 64)
SME1, 97 // larger than an integer
} // Field: SMEM overlay using greater than 32-bit field elements
}
Method (MTX_, )
{
/* Test "Force release" of mutex on method exit */
Acquire (MTXT, 0xFFFF)
Acquire (MTXX, 0xFFFF)
Store ("++++++++ Acquiring Mutex MTX2", Debug)
Acquire (_GL_, 0xFFFF)
Store ("++++++++ Releasing Mutex MTX2", Debug)
Release (_GL_)
}
Method (OBJ2, 1, Serialized)
{
Store ("++++++++ Creating Buffer BUFO", Debug)
Name (BUFO, Buffer (32) {})
Store ("++++++++ Creating OpRegion OPR2", Debug)
OperationRegion (OPR2, SystemMemory, Arg0, 256)
Store ("++++++++ Creating Field(s) in OpRegion OPR2", Debug)
Field (OPR2, ByteAcc, NoLock, Preserve)
{
IDX2, 8,
DAT2, 8,
BNK2, 4
}
Store ("++++++++ Creating BankField BNK2 in OpRegion OPR2", Debug)
//
// mcw 3/20/00 - changed FET0, 4, FET1, 3 to FET0, 1, FET1, 1
//
BankField (OPR2, BNK2, 0, ByteAcc, NoLock, Preserve)
{
FET0, 4,
FET1, 3
}
Store ("++++++++ Creating IndexField", Debug)
IndexField (IDX2, DAT2, ByteAcc, NoLock, Preserve)
{
FET2, 4,
FET3, 3
}
Store ("++++++++ SizeOf (BUFO)", Debug)
SizeOf (BUFO)
Store ("++++++++ Store (SizeOf (BUFO), Local0)", Debug)
Store (SizeOf (BUFO), Local0)
Store ("++++++++ Concatenate (\"abd\", \"def\", Local0)", Debug)
Concatenate ("abd", "def", Local0)
Store (Local0, Debug)
Store ("++++++++ Concatenate (\"abd\", 0x7B, Local0)", Debug)
Concatenate ("abd", 0x7B, Local0)
Store (Local0, Debug)
Store ("++++++++ Creating Event EVT2", Debug)
Event (EVT2)
Store ("++++++++ Creating Mutex MTX2", Debug)
Mutex (MTX2, 0)
Store ("++++++++ Creating Alias MTXA to MTX2", Debug)
Alias (MTX2, MTXA)
Store ("++++++++ Acquiring Mutex MTX2", Debug)
Acquire (MTX2, 0xFFFF)
Store ("++++++++ Acquiring Mutex MTX2 (2nd acquire)", Debug)
Acquire (MTX2, 1)
Store ("++++++++ Releasing Mutex MTX2", Debug)
Release (MTX2)
// Type 1 opcodes
Store ("++++++++ Signalling Event EVT2", Debug)
Signal (EVT2)
Store ("++++++++ Resetting Event EVT2", Debug)
Reset (EVT2)
Store ("++++++++ Signalling Event EVT2", Debug)
Signal (EVT2)
Store ("++++++++ Waiting Event EVT2", Debug)
Wait (EVT2, 0xFFFF)
Store ("++++++++ Sleep", Debug)
Sleep (100)
Store ("++++++++ Stall", Debug)
Stall (254)
Store ("++++++++ NoOperation", Debug)
Noop
// Type 2 Opcodes
Store ("++++++++ Return from Method OBJ2", Debug)
return (4)
}
Method (NUM1, 0)
{
/* ADD */
Store ("++++++++ Add (0x12345678, 0x11111111, Local0)", Debug)
Add (0x12345678, 0x11111111, Local0)
Store ("++++++++ Store (Add (0x12345678, 0x11111111), Local1)", Debug)
Store (Add (0x12345678, 0x11111111), Local1)
Store ("++++++++ Checking result from ADD", Debug)
if (LNotEqual (Local0, Local1))
{
ERR_ (0)
}
/* SUBTRACT */
Store ("++++++++ Subtract (0x87654321, 0x11111111, Local4)", Debug)
Subtract (0x87654321, 0x11111111, Local4)
Store ("++++++++ Store (Subtract (0x87654321, 0x11111111), Local5)", Debug)
Store (Subtract (0x87654321, 0x11111111), Local5)
Store ("++++++++ Checking result from SUBTRACT", Debug)
if (LNotEqual (Local4, Local5))
{
ERR_ (0)
}
/* MULTIPLY */
Store ("++++++++ Multiply (33, 10, Local6)", Debug)
Multiply (33, 10, Local6)
Store ("++++++++ Store (Multiply (33, 10), Local7)", Debug)
Store (Multiply (33, 10), Local7)
Store ("++++++++ Checking result from MULTIPLY", Debug)
if (LNotEqual (Local6, Local7))
{
ERR_ (0)
}
/* DIVIDE */
Store ("++++++++ Divide (100, 9, Local1, Local2)", Debug)
Divide (100, 9, Local1, Local2)
Store ("++++++++ Store (Divide (100, 9), Local3)", Debug)
Store (Divide (100, 9), Local3)
Store ("++++++++ Checking (quotient) result from DIVIDE", Debug)
if (LNotEqual (Local2, Local3))
{
ERR_ (0)
}
/* INCREMENT */
Store ("++++++++ Increment (Local0)", Debug)
Store (1, Local0)
Store (2, Local1)
Increment (Local0)
Store ("++++++++ Checking result from INCREMENT", Debug)
if (LNotEqual (Local0, Local1))
{
ERR_ (0)
}
/* DECREMENT */
Store ("++++++++ Decrement (Local0)", Debug)
Store (2, Local0)
Store (1, Local1)
Decrement (Local0)
Store ("++++++++ Checking result from DECREMENT", Debug)
if (LNotEqual (Local0, Local1))
{
ERR_ (0)
}
/* TOBCD */
/* FROMBCD */
Store ("++++++++ ToBCD (0x1234, Local5)", Debug)
ToBCD (0x1234, Local5)
Store ("++++++++ FromBCD (Local5, Local6)", Debug)
FromBCD (Local5, Local6)
Store ("++++++++ Return (Local6)", Debug)
Return (Local6)
}
Method (CHEK)
{
Store (3, Local0)
Store (3, Debug)
Store (Local0, Debug)
Store (7, Local1)
Add (Local0, Local1)
if (LNotEqual (Local0, 3))
{
ERR_ (2)
}
if (LNotEqual (Local1, 7))
{
ERR_ (2)
}
Add (Local0, Local1, Local2)
if (LNotEqual (Local0, 3))
{
ERR_ (2)
}
if (LNotEqual (Local1, 7))
{
ERR_ (2)
}
}
Method (RET1)
{
Store (3, Local0)
Return (Local0)
}
Method (RET2)
{
Return (RET1())
}
Method (RETZ)
{
RET2 ()
}
Method (BITZ)
{
Store ("++++++++ FindSetLeftBit (0x00100100, Local0)", Debug)
FindSetLeftBit (0x00100100, Local0)
if (LNotEqual (Local0, 21))
{
ERR_ (1)
}
Store ("++++++++ FindSetRightBit (0x00100100, Local1)", Debug)
FindSetRightBit (0x00100100, Local1)
if (LNotEqual (Local1, 9))
{
ERR_ (1)
}
Store ("++++++++ And (0xF0F0F0F0, 0x11111111, Local2)", Debug)
And (0xF0F0F0F0, 0x11111111, Local2)
if (LNotEqual (Local2, 0x10101010))
{
ERR_ (1)
}
Store ("++++++++ NAnd (0xF0F0F0F0, 0x11111111, Local3)", Debug)
NAnd (0xF0F0F0F0, 0x11111111, Local3)
if (LNotEqual (Local3, 0xEFEFEFEF))
{
ERR_ (1)
}
Store ("++++++++ Or (0x11111111, 0x22222222, Local4)", Debug)
Or (0x11111111, 0x22222222, Local4)
if (LNotEqual (Local4, 0x33333333))
{
ERR_ (1)
}
Store ("++++++++ NOr (0x11111111, 0x22222222, Local5)", Debug)
NOr (0x11111111, 0x22222222, Local5)
if (LNotEqual (Local5, 0xCCCCCCCC))
{
ERR_ (1)
}
Store ("++++++++ XOr (0x11113333, 0x22222222, Local6)", Debug)
XOr (0x11113333, 0x22222222, Local6)
if (LNotEqual (Local6, 0x33331111))
{
ERR_ (1)
}
Store ("++++++++ ShiftLeft (0x11112222, 2, Local7)", Debug)
ShiftLeft (0x11112222, 2, Local7)
if (LNotEqual (Local7, 0x44448888))
{
ERR_ (1)
}
Store ("++++++++ ShiftRight (Local7, 2, Local7)", Debug)
ShiftRight (Local7, 2, Local7)
if (LNotEqual (Local7, 0x11112222))
{
ERR_ (1)
}
Store ("++++++++ Not (Local0, Local1)", Debug)
Store (0x22224444, Local0)
Not (Local0, Local1)
if (LNotEqual (Local0, 0x22224444))
{
ERR_ (2)
}
if (LNotEqual (Local1, 0xDDDDBBBB))
{
ERR_ (1)
}
Return (Local7)
}
Method (LOGS)
{
Store ("++++++++ Store (LAnd (0xFFFFFFFF, 0x11111111), Local0)", Debug)
Store (LAnd (0xFFFFFFFF, 0x11111111), Local0)
Store ("++++++++ Store (LEqual (0xFFFFFFFF, 0x11111111), Local)", Debug)
Store (LEqual (0xFFFFFFFF, 0x11111111), Local1)
Store ("++++++++ Store (LGreater (0xFFFFFFFF, 0x11111111), Local2)", Debug)
Store (LGreater (0xFFFFFFFF, 0x11111111), Local2)
Store ("++++++++ Store (LGreaterEqual (0xFFFFFFFF, 0x11111111), Local3)", Debug)
Store (LGreaterEqual (0xFFFFFFFF, 0x11111111), Local3)
Store ("++++++++ Store (LLess (0xFFFFFFFF, 0x11111111), Local4)", Debug)
Store (LLess (0xFFFFFFFF, 0x11111111), Local4)
Store ("++++++++ Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)", Debug)
Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)
Store ("++++++++ Store (LNot (0x31313131), Local6)", Debug)
Store (0x00001111, Local6)
Store (LNot (Local6), Local7)
if (LNotEqual (Local6, 0x00001111))
{
ERR_ (2)
}
if (LNotEqual (Local7, 0x0))
{
ERR_ (1)
}
Store ("++++++++ Store (LNotEqual (0xFFFFFFFF, 0x11111111), Local7)", Debug)
Store (LNotEqual (0xFFFFFFFF, 0x11111111), Local7)
Store ("++++++++ Lor (0x0, 0x1)", Debug)
if (Lor (0x0, 0x1))
{
Store ("+_+_+_+_+ Lor (0x0, 0x1) returned TRUE", Debug)
}
return (Local7)
}
Method (COND)
{
Store ("++++++++ Store (0x4, Local0)", Debug)
Store (0x4, Local0)
Store ("++++++++ While (Local0)", Debug)
While (Local0)
{
Store ("++++++++ Decrement (Local0)", Debug)
Decrement (Local0)
}
Store ("++++++++ Store (0x3, Local6)", Debug)
Store (0x3, Local6)
Store ("++++++++ While (Subtract (Local6, 1))", Debug)
While (Subtract (Local6, 1))
{
Store ("++++++++ Decrement (Local6)", Debug)
Decrement (Local6)
}
Store ("++++++++ [LVL1] If (LGreater (0x2, 0x1))", Debug)
If (LGreater (0x2, 0x1))
{
Store ("++++++++ [LVL2] If (LEqual (0x11111111, 0x22222222))", Debug)
If (LEqual (0x11111111, 0x22222222))
{
Store ("++++++++ ERROR: If (LEqual (0x11111111, 0x22222222)) returned TRUE", Debug)
}
else
{
Store ("++++++++ [LVL3] If (LNot (0x0))", Debug)
If (LNot (0x0))
{
Store ("++++++++ [LVL4] If (LAnd (0xEEEEEEEE, 0x2))", Debug)
If (LAnd (0xEEEEEEEE, 0x2))
{
Store ("++++++++ [LVL5] If (LLess (0x44444444, 0x3))", Debug)
If (LLess (0x44444444, 0x3))
{
Store ("++++++++ ERROR: If (LLess (0x44444444, 0x3)) returned TRUE", Debug)
}
else
{
Store ("++++++++ Exiting from nested IF/ELSE statements", Debug)
}
}
}
}
}
Store ("++++++++ [LVL1] If (LGreater (0x2, 0x1))", Debug)
If (LGreater (0x2, 0x1))
{
Store ("++++++++ [LVL2] If (LEqual (0x11111111, 0x22222222))", Debug)
If (LEqual (0x11111111, 0x22222222))
{
Store ("++++++++ ERROR: If (LEqual (0x11111111, 0x22222222)) returned TRUE", Debug)
}
else
{
Store ("++++++++ [LVL3] If (LNot (0x0))", Debug)
If (LNot (0x0))
{
Store ("++++++++ [LVL4] If (LAnd (0xEEEEEEEE, 0x2))", Debug)
If (LAnd (0xEEEEEEEE, 0x2))
{
Store ("++++++++ [LVL5] If (LLess (0x44444444, 0x3))", Debug)
If (LLess (0x44444444, 0x3))
{
Store ("++++++++ ERROR: If (LLess (0x44444444, 0x3)) returned TRUE", Debug)
}
else
{
Store ("++++++++ Returning from nested IF/ELSE statements", Debug)
Return (Local6)
}
}
}
}
}
}
Method (REFS,, Serialized)
{
Name (BBUF, Buffer() {0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7})
Name (NEST, Package ()
{
Package ()
{
0x01, 0x02, 0x03, 0x04, 0x05, 0x06
},
Package ()
{
0x11, 0x12, 0x12, 0x14, 0x15, 0x16
}
})
Store (RefOf (MAIN), Local5)
// For this to work, ABCD must NOT exist.
Store (CondRefOf (ABCD, Local0), Local1)
if (LNotEqual (Local1, 0))
{
ERR_ (2)
}
Store (CondRefOf (BBUF, Local0), Local1)
if (LNotEqual (Local1, Ones))
{
ERR_ (2)
}
Store (DeRefOf (Index (BBUF, 3)), Local6)
if (LNotEqual (Local6, 0xB3))
{
ERR_ (2)
}
Store (DeRefOf (Index (DeRefOf (Index (NEST, 1)), 3)), Local0)
if (LNotEqual (Local0, 0x14))
{
ERR_ (2)
}
Store (0x11223344, Local0)
Store (RefOf (Local0), Local1)
Store (DerefOf (Local1), Local2)
If (LNotEqual (Local2, 0x11223344))
{
ERR_ (2)
}
/* Parser thinks this is a method invocation!! */
// RefOf (MAIN)
// RefOf (R___)
// RefOf (BBUF)
// Store (RefOf (Local0), Local1)
// CondRefOf (BBUF, Local2)
// CondRefOf (R___, Local3)
// Store (DerefOf (Local1), Local4)
// Return (Local4)
}
Method (INDX, 0, Serialized)
{
Name(STAT,Package(4){})
Store(0x44443333,Index(STAT,0))
}
//=================================================================
//=================================================================
//===================== iPCO TESTS ================================
//=================================================================
//=================================================================
//
//
// test IfElseOp.asl
//
// test for IfOp and ElseOp, including validation of object stack cleanup
//
Device (IFEL)
{
Name (DWRD, 1)
Name (RSLT, 0)
// IFNR control method executes IfOp branch with NO nested Return
// and no Else branch
Method (IFNR)
{
Store (DWRD, RSLT)
If (LEqual (DWRD, 1))
{
Store (0, RSLT)
}
} // IFNR
// NINR control method does not execute If branch and has no Else branch
Method (NINR)
{
Store (0, RSLT)
If (LNotEqual (DWRD, 1))
{
Store (DWRD, RSLT)
}
} // NINR
// IENR control method executes IfOp branch with NO nested Return
Method (IENR)
{
If (LEqual (DWRD, 1))
{
Store (0, RSLT)
}
Else
{
Store (DWRD, RSLT)
}
} // IENR
// ELNR control method executes ElseOp branch with NO nested Return
Method (ELNR)
{
If (LNotEqual (DWRD, 1))
{
Store (DWRD, RSLT)
}
Else
{
Store (0, RSLT)
}
} // ELNR
// IFRT control method executes IfOp branch with nested Return with
// no Else branch
Method (IFRT)
{
If (LEqual (DWRD, 1))
{
Return (0)
}
Return (DWRD)
} // IFRT
// IERT control method executes IfOp branch with nested Return with
// Else branch
Method (IERT)
{
If (LEqual (DWRD, 1))
{
Return (0)
}
Else
{
Return (DWRD)
}
} // IERT
// ELRT control method executes ElseOp branch with nested Return
Method (ELRT)
{
If (LNotEqual (DWRD, 1))
{
Return (DWRD)
}
Else
{
Return (0)
}
} // ELRT
Method (TEST)
{
Store ("++++++++ IfElseOp Test", Debug)
// IfOp with NO return value
IFNR()
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// IfOp with NO return value
NINR()
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// IfOp with NO return value
IENR()
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// ElseOp with NO return value
ELNR()
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// IfOp with return value
Store (IFRT, RSLT)
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// IfOp with return value
Store (IERT, RSLT)
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
// ElseOp with return value
Store (ELRT, RSLT)
If (LNotEqual (RSLT, 0))
{
Return (RSLT)
}
Return (0)
} // TEST
} // IFEL
//
// test NoSave.asl
//
//
// Internal test cases to validate IfOp (Operator (,,)) where Operator
// target is ZeroOp to throw away the results.
// Includes internal test cases for logical operators with no destination
// operands.
//
Device (NOSV)
{
Method (TEST,, Serialized)
{
Store ("++++++++ NoSave Test", Debug)
Name (WRD, 0x1234)
//
// Begin test of nested operators without saving results
//
// Test If (And ()) with no save of And result
If (And (3, 1, ))
{
Store (1, WRD) // pass -- just do something
}
else
{
Return (1) // fail
}
// Test If (And ()) with no save of And result
If (And (4, 1, ))
{
Return (2) // fail
}
else
{
Store (2, WRD) // pass -- just do something
}
// Test If (NAnd ()) with no save of NAnd result
If (NAnd (3, 1, ))
{
Store (3, WRD) // pass -- just do something
}
else
{
Return (3) // fail
}
// Test If (NAnd ()) with no save of NAnd result
If (NAnd (0xFFFFFFFF, 0xFFFFFFFF, ))
{
Return (4) // fail
}
else
{
Store (4, WRD) // pass -- just do something
}
// Test If (NOr ()) with no save of NOr result
If (NOr (0, 1, ))
{
Store (5, WRD) // pass -- just do something
}
else
{
Return (5) // fail
}
// Test If (NOr ()) with no save of NOr result
If (NOr (0xFFFFFFFE, 1, ))
{
Return (6) // fail
}
else
{
Store (6, WRD) // pass -- just do something
}
// Test If (Not ()) with no save of Not result
If (Not (1, ))
{
Store (7, WRD) // pass -- just do something
}
else
{
Return (7) // fail
}
// Test If (Not ()) with no save of Not result
If (Not (0xFFFFFFFF, ))
{
Return (8) // fail
}
else
{
Store (8, WRD) // pass -- just do something
}
// Test If (Or ()) with no save of Or result
If (Or (3, 1, ))
{
Store (9, WRD) // pass -- just do something
}
else
{
Return (9) // fail
}
// Test If (Or ()) with no save of Or result
If (Or (0, 0, ))
{
Return (10) // fail
}
else
{
Store (10, WRD) // pass -- just do something
}
// Test If (XOr ()) with no save of XOr result
If (XOr (3, 1, ))
{
Store (11, WRD) // pass -- just do something
}
else
{
Return (11) // fail
}
// Test If (XOr ()) with no save of XOr result
If (XOr (3, 3, ))
{
Return (12) // fail
}
else
{
Store (12, WRD) // pass -- just do something
}
//
// Begin test of logical operators with no destination operands
//
// Test If (LAnd ()) with no save of LAnd result
If (LAnd (3, 3))
{
Store (21, WRD) // pass -- just do something
}
else
{
Return (21) // fail
}
// Test If (LAnd ()) with no save of LAnd result
If (LAnd (3, 0))
{
Return (22) // fail
}
else
{
Store (22, WRD) // pass -- just do something
}
// Test If (LAnd ()) with no save of LAnd result
If (LAnd (0, 3))
{
Return (23) // fail
}
else
{
Store (23, WRD) // pass -- just do something
}
// Test If (LAnd ()) with no save of LAnd result
If (LAnd (0, 0))
{
Return (24) // fail
}
else
{
Store (24, WRD) // pass -- just do something
}
// Test If (LEqual ()) with no save of LEqual result
If (LEqual (3, 3))
{
Store (31, WRD) // pass -- just do something
}
else
{
Return (31) // fail
}
// Test If (LEqual ()) with no save of LEqual result
If (LEqual (1, 3))
{
Return (32) // fail
}
else
{
Store (32, WRD) // pass -- just do something
}
// Test If (LGreater ()) with no save of LGreater result
If (LGreater (3, 1))
{
Store (41, WRD) // pass -- just do something
}
else
{
Return (41) // fail
}
// Test If (LGreater ()) with no save of LGreater result
If (LGreater (4, 4))
{
Return (42) // fail
}
else
{
Store (42, WRD) // pass -- just do something
}
// Test If (LGreater ()) with no save of LGreater result
If (LGreater (1, 4))
{
Return (43) // fail
}
else
{
Store (43, WRD) // pass -- just do something
}
// Test If (LGreaterEqual ()) with no save of LGreaterEqual result
If (LGreaterEqual (3, 1))
{
Store (44, WRD) // pass -- just do something
}
else
{
Return (44) // fail
}
// Test If (LGreaterEqual ()) with no save of LGreaterEqual result
If (LGreaterEqual (3, 3))
{
Store (45, WRD) // pass -- just do something
}
else
{
Return (45) // fail
}
// Test If (LGreaterEqual ()) with no save of LGreaterEqual result
If (LGreaterEqual (3, 4))
{
Return (46) // fail
}
else
{
Store (46, WRD) // pass -- just do something
}
// Test If (LLess ()) with no save of LLess result
If (LLess (1, 3))
{
Store (51, WRD) // pass -- just do something
}
else
{
Return (51) // fail
}
// Test If (LLess ()) with no save of LLess result
If (LLess (2, 2))
{
Return (52) // fail
}
else
{
Store (52, WRD) // pass -- just do something
}
// Test If (LLess ()) with no save of LLess result
If (LLess (4, 2))
{
Return (53) // fail
}
else
{
Store (53, WRD) // pass -- just do something
}
// Test If (LLessEqual ()) with no save of LLessEqual result
If (LLessEqual (1, 3))
{
Store (54, WRD) // pass -- just do something
}
else
{
Return (54) // fail
}
// Test If (LLessEqual ()) with no save of LLessEqual result
If (LLessEqual (2, 2))
{
Store (55, WRD) // pass -- just do something
}
else
{
Return (55) // fail
}
// Test If (LLessEqual ()) with no save of LLessEqual result
If (LLessEqual (4, 2))
{
Return (56) // fail
}
else
{
Store (56, WRD) // pass -- just do something
}
// Test If (LNot ()) with no save of LNot result
If (LNot (0))
{
Store (61, WRD) // pass -- just do something
}
else
{
Return (61) // fail
}
// Test If (LNot ()) with no save of LNot result
If (LNot (1))
{
Return (62) // fail
}
else
{
Store (62, WRD) // pass -- just do something
}
// Test If (LNotEqual ()) with no save of LNotEqual result
If (LNotEqual (3, 3))
{
Return (63) // fail
}
else
{
Store (63, WRD) // pass -- just do something
}
// Test If (LNotEqual ()) with no save of LNotEqual result
If (LNotEqual (1, 3))
{
Store (64, WRD) // pass -- just do something
}
else
{
Return (64) // fail
}
// Test If (LOr ()) with no save of LOr result
If (LOr (3, 1))
{
Store (71, WRD) // pass -- just do something
}
else
{
Return (71) // fail
}
// Test If (LOr ()) with no save of LOr result
If (LOr (0, 1))
{
Store (72, WRD) // pass -- just do something
}
else
{
Return (72) // fail
}
// Test If (LOr ()) with no save of LOr result
If (LOr (3, 0))
{
Store (73, WRD) // pass -- just do something
}
else
{
Return (73) // fail
}
// Test If (LOr ()) with no save of LOr result
If (LOr (0, 0))
{
Return (74) // fail
}
else
{
Store (74, WRD) // pass -- just do something
}
Return (0)
} // TEST
} // NOSV
//
// test IndxFld.asl
//
// IndexFld test
// This is just a subset of the many RegionOp/Index Field test cases.
// Tests index field element AccessAs macro.
//
Device (IDXF)
{ // Test device name
OperationRegion (SIO, SystemIO, 0x100, 2)
Field (SIO, ByteAcc, NoLock, Preserve)
{
INDX, 8,
DATA, 8
}
IndexField (INDX, DATA, AnyAcc, NoLock, WriteAsOnes)
{
AccessAs (ByteAcc, 0),
IFE0, 8,
IFE1, 8,
IFE2, 8,
IFE3, 8,
IFE4, 8,
IFE5, 8,
IFE6, 8,
IFE7, 8,
IFE8, 8,
IFE9, 8,
}
Method (TEST)
{
Store ("++++++++ IndxFld Test", Debug)
Store (IFE0, Local0)
Store (IFE1, Local1)
Store (IFE2, Local2)
Return (0)
} // TEST
} // IDXF
//
// test NestdLor.asl
//
Scope (\_SB) // System Bus
{ // _SB system bus
Name (ZER0, 0)
Name (ZER1, 0)
Name (ZER2, 0)
Name (ONE0, 1)
Device (NSTL)
{
Method (TEST)
{
Store ("++++++++ NestdLor Test", Debug)
If (Lor (ZER0, Lor (ZER1, Lor (ZER2, ONE0))))
{ // Indicate Pass
Store (0x00, Local0)
}
Else
{ // Indicate Fail
Store (0x01, Local0)
}
Return (Local0)
} // End Method TEST
} // Device NSTL
} // _SB system bus
//
// test RetBuf.asl
//
// Test ReturnOp(Buffer)
// This is required to support Control Method Batteries on
// Dell Latitude Laptops (e.g., CP1-A)
//
Device (RTBF)
{
Method (SUBR, 1)
{
Return (Arg0)
}
Method (RBUF,, Serialized)
{ // RBUF: Return Buffer from local variable
Name (ABUF, Buffer() {"ARBITRARY_BUFFER"})
// store local buffer ABUF into Local0
Store (ABUF, Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Buffer
If (LNotEqual (Local1, 3)) // Buffer type is 3
{
Return (1) // failure
}
// store value returned by control method SUBR into Local0
Store (SUBR (ABUF), Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Buffer
If (LNotEqual (Local1, 3)) // Buffer type is 3
{
Return (2) // failure
}
// allocate buffer using Local1 as buffer size (run-time evaluation)
Store (5, Local1)
Name (BUFR, Buffer(Local1) {})
// store value returned by control method SUBR into Local0
Store (SUBR (BUFR), Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Buffer
If (LNotEqual (Local1, 3)) // Buffer type is 3
{
Return (3) // failure
}
// store BUFR Buffer into Local0
Store (BUFR, Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Buffer
If (LNotEqual (Local1, 3)) // Buffer type is 3
{
Return (4) // failure
}
// return Local0 Buffer
Return (Local0)
} // RBUF
Method (TEST)
{
Store ("++++++++ RetBuf Test", Debug)
// store RBUF Buffer return value into Local0
Store (RBUF, Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Buffer
If (LNotEqual (Local1, 3)) // Buffer type is 3
{
Return (10) // failure
}
Else
{
Return (0) // success
}
} // TEST
} // RTBF
//
// test RetLVal.asl
//
// Test ReturnOp(Lvalue)
// This is required to support _PSR on IBM ThinkPad 560D and
// _DCK on Toshiba Tecra 8000.
//
Device (GPE2)
{
Method (_L03)
{
Store ("Method GPE2._L03 invoked", Debug)
Return ()
}
Method (_E05)
{
Store ("Method GPE2._E05 invoked", Debug)
Return ()
}
}
Device (PRW2)
{
Name (_PRW, Package(2) {Package(2){\GPE2, 0x05}, 3})
}
Scope (\_GPE)
{
Name (ACST, 0xFF)
Method (_L08)
{
Store ("Method _GPE._L08 invoked", Debug)
Return ()
}
Method (_E09)
{
Store ("Method _GPE._E09 invoked", Debug)
Return ()
}
Method (_E11)
{
Store ("Method _GPE._E11 invoked", Debug)
Notify (\PRW1, 2)
}
Method (_L22)
{
Store ("Method _GPE._L22 invoked", Debug)
Return ()
}
Method (_L33)
{
Store ("Method _GPE._L33 invoked", Debug)
Return ()
}
Method (_E64)
{
Store ("Method _GPE._E64 invoked", Debug)
Return ()
}
} // _GPE
Device (PRW1)
{
Name (_PRW, Package(2) {0x11, 3})
}
Device (PWRB)
{
Name (_HID, EISAID("PNP0C0C"))
Name (_PRW, Package(2) {0x33, 3})
}
Scope (\_SB) // System Bus
{ // _SB system bus
Device (ACAD)
{ // ACAD: AC adapter device
Name (_HID, "ACPI0003") // AC adapter device
Name (_PCL, Package () {\_SB})
OperationRegion (AREG, SystemIO, 0x0372, 2)
Field (AREG, ByteAcc, NoLock, Preserve)
{
AIDX, 8,
ADAT, 8
}
IndexField (AIDX, ADAT, ByteAcc, NoLock, Preserve)
{
, 1, // skips
ACIN, 1,
, 2, // skips
CHAG, 1,
, 3, // skips
, 7, // skips
ABAT, 1,
} // IndexField
Method (_PSR)
{
Store (\_GPE.ACST, Local0)
Store (ACIN, Local1)
If (LNotEqual (\_GPE.ACST, Local1))
{
Store (Local1, \_GPE.ACST)
// This Notify is commented because it causes a
// method error when running on a system without the
// specific device.
// Notify (\_SB_.ACAD, 0)
}
Return (Local0)
} // _PSR
Method (_STA)
{
Return (0x0F)
}
Method (_INI)
{
Store (ACIN, \_GPE.ACST)
}
} // ACAD: AC adapter device
// test implicit return from control method
Method (DIS_, 1)
{
Store (Arg0, Local0)
}
Device (RTLV)
{
// test implicit return inside nested if with explicit return of Lvalue
Method (_DCK, 1)
// Arg0: 1 == dock, 0 == undock
{
If (Arg0)
{ // dock
Store (0x87, Local0)
If (Local0)
{
DIS_ (0x23)
Return (1)
}
Return (0)
} // dock
Else
{ // undock
Store (Arg0, Local0)
If (Local0)
{
DIS_ (0x23)
Return (1)
}
Return (0)
} // undock
} // _DCK control method
Method (TEST)
{
Store ("++++++++ RetLVal Test", Debug)
// store _PSR return value into Local0
Store (\_SB_.ACAD._PSR, Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Number
If (LNotEqual (Local1, 1)) // Number/Integer type is 1
{
Return (1) // failure
}
// test implicit return inside nested if with explicit return of Lvalue
Store (_DCK (1), Local2)
// save Local2 object type value into Local3
Store (ObjectType (Local2), Local3)
// validate Local2 is a Number
If (LNotEqual (Local3, 1)) // Number/Integer type is 1
{
Return (2) // failure
}
If (LNotEqual (Local2, 1))
{
Return (3) // failure
}
Return (0) // success
} // TEST
} // RTLV
} // _SB system bus
//
// test RetPkg.asl
//
// Test ReturnOp(Package)
// This is required to support _PRT on Dell Optiplex Workstations (e.g. GX1)
//
Scope (\_SB) // System Bus
{ // _SB system bus
Device(LNKA)
{
Name (_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name (_UID, 1)
}
Device(LNKB)
{
Name (_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name (_UID, 2)
}
Device(LNKC)
{
Name (_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name (_UID, 3)
}
Device(LNKD)
{
Name (_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name (_UID, 4)
}
Device (PCI1)
{ // PCI1: Root PCI Bus
Name (_HID, "PNP0A03") // Need _HID for root device (String format)
Name (_ADR,0x00000000)
Name (_CRS,0)
Name (_PRT, Package ()
{
Package () {0x0004ffff, 0, LNKA, 0}, // Slot 1, INTA
Package () {0x0004ffff, 1, LNKB, 0}, // Slot 1, INTB
Package () {0x0004ffff, 2, LNKC, 0}, // Slot 1, INTC
Package () {0x0004ffff, 3, LNKD, 0}, // Slot 1, INTD
Package () {0x0005ffff, 0, \_SB_.LNKB, 0}, // Slot 2, INTA
Package () {0x0005ffff, 1, \_SB_.LNKC, 0}, // Slot 2, INTB
Package () {0x0005ffff, 2, \_SB_.LNKD, 0}, // Slot 2, INTC
Package () {0x0006ffff, 3, \_SB_.LNKA, 0}, // Slot 2, INTD
Package () {0x0006ffff, 0, LNKC, 0}, // Slot 3, INTA
Package () {0x0006ffff, 1, LNKD, 0}, // Slot 3, INTB
Package () {0x0006ffff, 2, LNKA, 0}, // Slot 3, INTC
Package () {0x0006ffff, 3, LNKB, 0}, // Slot 3, INTD
})
Device (PX40)
{ // Map f0 space, Start PX40
Name (_ADR,0x00070000) // Address+function.
}
} // PCI0: Root PCI Bus
Device (RETP)
{
Method (RPKG)
{ // RPKG: Return Package from local variable
// store _PRT package into Local0
Store (\_SB_.PCI1._PRT, Local0)
// return Local0 Package
Return (Local0)
} // RPKG
Method (TEST)
{
Store ("++++++++ RetPkg Test", Debug)
// store RPKG package return value into Local0
Store (RPKG, Local0)
// save Local0 object type value into Local1
Store (ObjectType (Local0), Local1)
// validate Local0 is a Package
If (LNotEqual (Local1, 4)) // Package type is 4
{ Return (1) } // failure
Else
{ Return (0) } // success
} // TEST
} // RETP
} // _SB_
//
// test WhileRet.asl
//
// WhileRet.asl tests a ReturnOp nested in a IfOp nested in a WhileOp.
//
Device (WHLR)
{
Name (LCNT, 0)
Method (WIR)
{ // WIR: control method that returns inside of IfOp inside of WhileOp
While (LLess (LCNT, 4))
{
If (LEqual (LCNT, 2))
{
Return (0)
}
Increment (LCNT)
}
Return (LCNT)
} // WIR: control method that returns inside of IfOp inside of WhileOp
Method (TEST)
{
Store ("++++++++ WhileRet Test", Debug)
Store (WIR, Local0)
Return (Local0)
} // TEST
} // WHLR
//
// test AndOrOp.asl
//
//This code tests the bitwise AndOp and OrOp Operator terms
//
//Syntax of Andop term
//And - Bitwise And
//AndTerm := And(
// Source1, //TermArg=>Integer
// Source2, //TermArg=>Integer
// Result //Nothing | SuperName
//) => Integer
//Source1 and Source2 are evaluated as integer data types,
// a bit-wise AND is performed, and the result is optionally
//stored into Result.
//
//
//Syntax of OrOp
//Or - Bit-wise Or
//OrTerm := Or(
// Source1, //TermArg=>Integer
// Source2 //TermArg=>Integer
// Result //Nothing | SuperName
//) => Integer
//Source1 and Source2 are evaluated as integer data types,
// a bit-wide OR is performed, and the result is optionally
//stored in Result
//
Device (ANDO)
{
OperationRegion (TMEM, SystemMemory, 0xC4, 0x02)
Field (TMEM, ByteAcc, NoLock, Preserve)
{
, 3,
TOUD, 13
}
//Create System Memory Operation Region and field overlays
OperationRegion (RAM, SystemMemory, 0x400000, 0x100)
Field (RAM, AnyAcc, NoLock, Preserve)
{
SMDW, 32, // 32-bit DWORD
SMWD, 16, // 16-bit WORD
SMBY, 8, // 8-bit BYTE
}// Field(RAM)
//And with Byte Data
Name (BYT1, 0xff)
Name (BYT2, 0xff)
Name (BRSL, 0x00)
//And with Word Data
Name (WRD1, 0xffff)
Name (WRD2, 0xffff)
Name (WRSL, 0x0000)
//And with DWord Data
Name (DWD1, 0xffffffff)
Name (DWD2, 0xffffffff)
Name (DRSL, 0x00000000)
Method (ANDP)
{
//Check with 1 And 1 on byte data
And(BYT1, BYT2, BRSL)
if(LNotEqual(BRSL,0xff))
{Return(1)}
//Check with 1 And 1 on Word data
And(WRD1, WRD2, WRSL)
if(LNotEqual(WRSL,0xffff))
{
Return (1) // failure
}
//Check with 1 And 1 Dword
And(DWD1, DWD2, DRSL)
if(LNotEqual(DRSL,0xffffffff))
{
Return (1) // failure
}
//Check with 0 And 0 on byte data
Store(0x00,BYT1)
Store(0x00,BYT2)
Store(0x00,BRSL)
And(BYT1, BYT2, BRSL)
if(LNotEqual(BRSL,0x00))
{
Return (1) // failure
}
//Check with 0 And 0 on Word data
Store (0x0000,WRD1)
Store (0x0000,WRD2)
Store (0x0000,WRSL)
And(WRD1, WRD2, WRSL)
if(LNotEqual(WRSL,0x0000))
{
Return (1) // failure
}