当前位置: 首页>>代码示例>>C#>>正文


C# IHardwareResources.GetIOPortRegion方法代码示例

本文整理汇总了C#中IHardwareResources.GetIOPortRegion方法的典型用法代码示例。如果您正苦于以下问题:C# IHardwareResources.GetIOPortRegion方法的具体用法?C# IHardwareResources.GetIOPortRegion怎么用?C# IHardwareResources.GetIOPortRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IHardwareResources的用法示例。


在下文中一共展示了IHardwareResources.GetIOPortRegion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "TEST_" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            TestPort = hardwareResources.GetIOPort(0, 0);

            Command = new CommandRegister(TestPort, 8);

            Command.Enabled = true;

            return true;
        }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:17,代码来源:TestDriver.cs

示例2: ClaimResources

        /// <summary>
        /// Claims the resources.
        /// </summary>
        /// <param name="hardwareResources">The hardware resources.</param>
        /// <returns></returns>
        public bool ClaimResources(IHardwareResources hardwareResources)
        {
            spinLock.Enter();

            for (byte r = 0; r < hardwareResources.IOPointRegionCount - 1; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    if (portUsed[region.BaseIOPort + p])
                        return false;
            }

            for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    portUsed[region.BaseIOPort + p] = true;
            }

            spinLock.Exit();

            return true;
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:28,代码来源:IOPortResources.cs

示例3: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "AMDPCNet_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            ioProm1 = hardwareResources.GetIOPort(0, 0x0);
            ioProm4 = hardwareResources.GetIOPort(0, 0x4);
            rdp = hardwareResources.GetIOPort(0, 0x10);
            rap = hardwareResources.GetIOPort(0, 0x14);
            bdp = hardwareResources.GetIOPort(0, 0x1C);

            initBlock = hardwareResources.GetMemory(0);
            txDescriptor = hardwareResources.GetMemory(1);
            rxDescriptor = hardwareResources.GetMemory(2);
            buffers = hardwareResources.GetMemory(3);

            bufferSize = 2048;
            uint len = (ushort)(~bufferSize);
            len = (len + 1) & 0x0FFF | 0x8000F000;

            physicalBufferAddress = HAL.GetPhysicalAddress(buffers);

            for (uint index = 0; index < 16; index++)
            {
                uint offset = index * 4;
                rxDescriptor.Write32((offset + 1) * 4, len);
                rxDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * index));
                txDescriptor.Write32((offset + 2) * 4, physicalBufferAddress + (bufferSize * (index + 16)));
            }

            nextTXDesc = 0;

            return true;
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:38,代码来源:AMDPCNetII.cs

示例4: ReleaseResources

        /// <summary>
        /// Releases the resources.
        /// </summary>
        /// <param name="hardwareResources">The hardware resources.</param>
        public void ReleaseResources(IHardwareResources hardwareResources)
        {
            spinLock.Enter();

            for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
            {
                IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
                for (int p = 0; p < region.Size; p++)
                    portUsed[region.BaseIOPort + p] = false;
            }

            spinLock.Exit();
        }
开发者ID:pacificIT,项目名称:MOSA-Project,代码行数:17,代码来源:IOPortResources.cs

示例5: Setup

        /// <summary>
        /// Setups this hardware device driver
        /// </summary>
        /// <returns></returns>
        public override bool Setup(IHardwareResources hardwareResources)
        {
            this.hardwareResources = hardwareResources;
            base.name = "VMWARE_SVGA_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");

            indexPort = hardwareResources.GetIOPort(0, 0);
            valuePort = hardwareResources.GetIOPort(0, 1);

            memory = base.hardwareResources.GetMemory(0);
            fifo = base.hardwareResources.GetMemory(1);

            return true;
        }
开发者ID:hj1980,项目名称:Mosa,代码行数:17,代码来源:VMwareSVGAII.cs


注:本文中的IHardwareResources.GetIOPortRegion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。