Exemplo n.º 1
0
        private void ReadNext()
        {
            string line = trace.ReadLine();

            isDone = (line == null || line.Trim() == "");

            if (!isDone)
            {
                string[] fields = line.Trim().Split(new char[] { ' ' });
                isRead      = fields[0].StartsWith("r");
                isWrite     = !isRead; // Just for readability
                regionSpace = (AcpiObject.RegionSpace) int.Parse(fields[1]);
                offset      = ulong.Parse(fields[2]);
                length      = ulong.Parse(fields[3]);
                if (fields.Length > 4)
                {
                    value = ulong.Parse(fields[4]);
                }

                if (fields.Length != 5)
                {
                    valueSequence = new byte[fields.Length - 4];
                    for (int i = 0; i < valueSequence.Length; i++)
                    {
                        valueSequence[i] = byte.Parse(fields[4 + i]);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Write32(AcpiObject.RegionSpace regionSpace, ulong offset, uint value)
 {
     Console.WriteLine("Write32 at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
     if (!(isWrite && length == 4 && regionSpace == this.regionSpace && offset == this.offset && value == this.value))
     {
         throw new MismatchedTraceException();
     }
     ReadNext();
 }
Exemplo n.º 3
0
 public byte[] ReadBytes(AcpiObject.RegionSpace regionSpace, ulong offset, ulong length)
 {
     Console.WriteLine("Read " + length + " bytes at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
     byte[] result = new byte[length];
     for (ulong i = 0; i < length; i++)
     {
         result[i] = 10;
     }
     return(result);
 }
Exemplo n.º 4
0
 public byte[] ReadBytes(AcpiObject.RegionSpace regionSpace, ulong offset, ulong length)
 {
     Console.WriteLine("Read " + length + " bytes at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
     if (!(isRead && length == (ulong)valueSequence.Length && regionSpace == this.regionSpace && offset == this.offset))
     {
         throw new MismatchedTraceException();
     }
     byte[] result = valueSequence;
     ReadNext();
     return(valueSequence);
 }
Exemplo n.º 5
0
        public uint Read32(AcpiObject.RegionSpace regionSpace, ulong offset)
        {
            Console.WriteLine("Read32 at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
            if (!(isRead && length == 4 && regionSpace == this.regionSpace && offset == this.offset))
            {
                throw new MismatchedTraceException();
            }
            uint result = (uint)value;

            ReadNext();
            return(result);
        }
Exemplo n.º 6
0
 public void Write32(AcpiObject.RegionSpace regionSpace, ulong offset, uint value)
 {
     Console.WriteLine("Write32 at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
 }
Exemplo n.º 7
0
 public uint Read32(AcpiObject.RegionSpace regionSpace, ulong offset)
 {
     Console.WriteLine("Read32 at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
     return(1024);
 }
Exemplo n.º 8
0
 public byte Read8(AcpiObject.RegionSpace regionSpace, ulong offset)
 {
     Console.WriteLine("Read8 at " + regionSpace.ToString() + ":0x" + offset.ToString("X"));
     return(10);
 }