Пример #1
0
            public override void Visit(AmlParser.DefBuffer defBuffer)
            {
                defBuffer.bufferSize.integer.Accept(this);
                AcpiObject.AcpiObject bufferSizeObj = result;
                CheckObjectType(bufferSizeObj, AcpiObjectType.Integer);

                byte[] contents = new byte[((AcpiObject.Integer)(bufferSizeObj.GetTarget())).Value];
                Array.Copy(defBuffer.byteList, contents, defBuffer.byteList.Length);
                result = new AcpiObject.Buffer(contents);
            }
Пример #2
0
        public override void Visit(ComputationalData computationalData)
        {
            switch (computationalData.Tag)
            {
            case ComputationalData.TagValue.ByteConst:
                byte byteConst = computationalData.GetAsByteConst();
                result.Add(new PushConst(new AcpiObject.Integer(byteConst)));
                break;

            case ComputationalData.TagValue.WordConst:
                UInt16 wordConst = computationalData.GetAsWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(wordConst)));
                break;

            case ComputationalData.TagValue.DWordConst:
                UInt32 dWordConst = computationalData.GetAsDWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(dWordConst)));
                break;

            case ComputationalData.TagValue.QWordConst:
                UInt64 qWordConst = computationalData.GetAsQWordConst();
                result.Add(new PushConst(new AcpiObject.Integer(qWordConst)));
                break;

            case ComputationalData.TagValue.StringConst:
                string stringConst = computationalData.GetAsStringConst();
                result.Add(new PushConst(new AcpiObject.String(stringConst)));
                break;

            case ComputationalData.TagValue.ConstObj:
                AmlParser.ConstObj constObj = computationalData.GetAsConstObj();
                switch (constObj.op)
                {
                case AmlParser.ZeroOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.Zero));
                    break;

                case AmlParser.OneOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.One));
                    break;

                case AmlParser.OnesOp:
                    result.Add(new PushConst(AcpiObject.IntegerConstant.Ones));
                    break;
                }
                break;

            case ComputationalData.TagValue.RevisionOp:
                result.Add(new PushConst(AcpiObject.IntegerConstant.Revision));
                break;

            case ComputationalData.TagValue.DefBuffer:
                AmlParser.DefBuffer defBuffer = computationalData.GetAsDefBuffer();
                defBuffer.Accept(this);
                break;

            default:
                Debug.Assert(false, "Unhandled alternative in switch over 'ComputationalData'");
                break;
            }
        }
Пример #3
0
 public override void Visit(AmlParser.DefBuffer defBuffer)
 {
     defBuffer.bufferSize.integer.Accept(this);
     result.Add(new DefBuffer(defBuffer.byteList));
 }
Пример #4
0
 public virtual void Visit(AmlParser.DefBuffer defBuffer)
 {
     UnhandledNodeType("DefBuffer");
 }