Esempio n. 1
0
        public unsafe void Fill(uint aByteOffset, uint aCount, uint aData)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            uint *xDest = (uint *)(Base + aByteOffset);

            MemoryOperations.Fill(xDest, aData, (int)aCount);
        }
        public unsafe void Fill(UInt32 aStart, UInt32 aCount, byte aData)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            byte *xDest = (byte *)(this.Base + aStart);

            MemoryOperations.Fill(xDest, aData, (int)aCount);
        }
Esempio n. 3
0
        public unsafe void MoveDown(uint aDest, uint aSrc, uint aCount)
        {
            byte *xDest = (byte *)(Base + aDest);
            byte *xSrc  = (byte *)(Base + aSrc);

            MemoryOperations.Copy(xDest, xSrc, (int)aCount);
        }
Esempio n. 4
0
        /// <summary>
        /// Copy MemoryBlock into ManagedMemoryBlock
        /// </summary>
        /// <param name="block">MemoryBlock to copy.</param>
        public unsafe void Copy(MemoryBlock block)
        {
            byte *xDest    = (byte *)(this.Offset);
            byte *aDataPtr = (byte *)block.Base;

            MemoryOperations.Copy(xDest, aDataPtr, (int)block.Size);
        }
Esempio n. 5
0
        /// <summary>
        /// Copy ManagedMemoryBlock into MemoryBlock
        /// </summary>
        /// <param name="block">ManagedMemoryBlock to copy.</param>
        public unsafe void Copy(ManagedMemoryBlock block)
        {
            byte *xDest    = (byte *)(Base);
            byte *aDataPtr = (byte *)block.Offset;

            MemoryOperations.Copy(xDest, aDataPtr, (int)block.Size);
        }
Esempio n. 6
0
 /// <summary>
 /// Fill memory block.
 /// </summary>
 /// <param name="aData">A data to fill.</param>
 public void Fill(uint aData)
 {
     fixed(byte *destPtr = this.memory)
     {
         MemoryOperations.Fill(destPtr, (int)aData, (int)this.Size);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Fill data to memory block.
 /// </summary>
 /// <param name="aStart">A starting position in the memory block.</param>
 /// <param name="aCount">Data size.</param>
 /// <param name="aData">A data to fill memory block with.</param>
 public unsafe void Fill(int aStart, int aCount, int aData)
 {
     // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
     fixed(byte *aArrayPtr = this.memory)
     {
         MemoryOperations.Fill(aArrayPtr + aStart, aData, (int)aCount);
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Copy data from the buffer array to the memory block.
        /// </summary>
        /// <param name="aByteOffset">Starting point offset in bytes</param>
        /// <param name="aData">A data buffer array.</param>
        /// <param name="aIndex">A staring index in the source data buffer array.</param>
        /// <param name="aCount">Number of integers to copy.</param>
        public unsafe void Copy(int aByteOffset, int[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            int *xDest = (int *)(Base + aByteOffset);

            fixed(int *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }
Esempio n. 9
0
        unsafe public void Copy(uint aStart, uint[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            uint *xDest = (uint *)(Base + aStart);

            Global.mDebugger.SendInternal($"Base is {Base} xDest is {(uint)xDest}");
            fixed(uint *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Convert part for the memory block to array.
        /// </summary>
        /// <param name="aStart">A starting position of the data at the source memory block.</param>
        /// <param name="aIndex">A index to be the staring index at the destination array.</param>
        /// <param name="aCount">Number of bytes to get.</param>
        /// <returns>uint array.</returns>
        public unsafe uint[] ToArray(int aStart, int aIndex, int aCount)
        {
            uint *xDest = (uint *)(Base + aStart);

            uint[] array = new uint[aCount];
            fixed(uint *aArrayPtr = array)
            {
                MemoryOperations.Copy(aArrayPtr + aIndex, xDest, aCount);
            }

            return(array);
        }
Esempio n. 11
0
        public unsafe void Copy(int aStart, int[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            int *xDest;

            fixed(byte *aArrayPtr = this.memory)
            {
                xDest = (int *)(aArrayPtr + aStart);
            }

            fixed(int *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }