Beispiel #1
0
        }//ShutDown

        /// <summary>
        /// Get data from memory.
        /// If address is in range of main memory, get from main memory block.
        /// If address is not in range, pass to the plugins to see if they are interested.
        /// </summary>
        /// <param name="address">address to read</param>
        /// <param name="ms">size to read</param>
        /// <returns>read value</returns>
        public override uint GetMemory(uint address, ARMPluginInterfaces.MemorySize ms)
        {
            if (this.MainMemory.InRange(address, ms))
            {
                return(mL1DataCache.GetMemory(address, ms));
            }
            return(mPluginManager.MemoryRead(address, ms));
        }//GetMemory
Beispiel #2
0
 /// <summary>
 /// Test if a given memory address and size has been requested by a plugin.
 /// </summary>
 /// <param name="address"></param>
 /// <param name="ms"></param>
 /// <returns></returns>
 public bool InRange(uint address, ARMPluginInterfaces.MemorySize ms)
 {
     //search the overridden memory and determine if a plugin has
     //overridden it. If so, execute its callback and return the result.
     foreach (MemoryRange mr in mMemoryMaps)
     {
         if (mr.hitTest(address))
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
 public override uint GetMemoryNoSideEffect(uint address, ARMPluginInterfaces.MemorySize ms)
 {
     if (mMemoryBlock == null)
     {
         return(0);  // no memory allocated yet
     }
     //System.Diagnostics.Debug.Assert(this.InRange(address, ms));
     if (mMemoryBlock.InRange(address, ms))
     {
         return(mMemoryBlock.GetMemory(address, ms));
     }
     if (mPluginManager.InRange(address, ms))
     {
         return(mPluginManager.MemoryRead(address, ms));
     }
     throw new MemoryAccessException(address, false);
 }
Beispiel #4
0
        }//GetMemory

        /// <summary>
        /// Store data in memory.
        /// If address is in range of main memory, send to main memory block.
        /// If address is not in range, pass to the plugins to see if they are interested.
        /// Throw an exception if address out of range and no plugin handles the store.
        /// </summary>
        /// <param name="address">address to write</param>
        /// <param name="ms">size to write</param>
        /// <param name="data">data to write</param>
        public override void SetMemory(uint address, ARMPluginInterfaces.MemorySize ms, uint data)
        {
            if (this.ProtectTextArea)
            {
                if (this.MainMemory.InDataRange(address, ms))
                {
                    mL1DataCache.SetMemory(address, ms, data);
                    return;
                }
            }
            else
            if (this.MainMemory.InRange(address, ms))
            {
                mL1DataCache.SetMemory(address, ms, data);
                return;
            }
            mPluginManager.MemoryWrite(address, ms, data);
        }//SetMemory
Beispiel #5
0
 /// <summary>
 /// Test if a memory operation is in range of the main memory block.
 /// </summary>
 /// <param name="address">address to test</param>
 /// <param name="ms">size of memory operation</param>
 /// <returns>true if in range</returns>
 public override bool InRange(uint address, ARMPluginInterfaces.MemorySize ms)
 {
     return(mMemoryBlock.InRange(address, ms) || mPluginManager.InRange(address, ms));
 }//InRange