本文整理汇总了C#中IDevice.Map方法的典型用法代码示例。如果您正苦于以下问题:C# IDevice.Map方法的具体用法?C# IDevice.Map怎么用?C# IDevice.Map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDevice
的用法示例。
在下文中一共展示了IDevice.Map方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Map
public void Map(ushort baseAddress, ushort sizeInBytes, IDevice device)
{
ArgumentCheck.NotNull(device, "device");
if (device.RequestSnooping) {
if (snooper != null)
throw new InternalErrorException("Only one snooper is allowed.");
snooper = device;
}
for (int addr = baseAddress; addr < baseAddress + sizeInBytes; addr += pageSize)
{
int pageno = (addr & addrSpaceMask) >> pageShift;
memoryMap[pageno] = device;
}
device.Map(this);
Debug.WriteLine(String.Format("{0}: Mapped {1} to ${2:x4}:${3:x4}",
this, device, baseAddress, baseAddress + sizeInBytes));
}
示例2: Map
public void Map(ushort basea, ushort size, IDevice device)
{
if (device == null)
{
throw new ArgumentNullException("device");
}
for (int addr = basea; addr < basea + size; addr += PageSize)
{
int pageno = (addr & AddrSpaceMask) >> PageShift;
MemoryMap[pageno] = device;
}
device.Map(this);
Debug.WriteLine(String.Format("{0}: Mapped {1} to ${2:x4}:${3:x4}",
this, device, basea, basea + size));
}