Ejemplo n.º 1
0
        /********************
         *     utilities    *
         *********************/

        /* public methods */

        public string[] AddrDescToString(bool bMemOnly)
        {
            string[] sAddr = new string[AddrDesc.Length];
            for (int i = 0; i < sAddr.Length; ++i)
            {
                sAddr[i] = "BAR " + AddrDesc[i].dwAddrSpace.ToString() +
                           ((AddrDesc[i].fIsMemory)? " Memory " : " I/O ");

                if (wdc_lib_decl.WDC_AddrSpaceIsActive(Handle,
                                                       AddrDesc[i].dwAddrSpace))
                {
                    WD_ITEMS item =
                        m_wdcDevice.cardReg.Card.Item[AddrDesc[i].dwItemIndex];
                    UINT64 dwAddr = (UINT64)(AddrDesc[i].fIsMemory?
                                             item.I.Mem.dwPhysicalAddr : item.I.IO.dwAddr);

                    sAddr[i] += dwAddr.ToString("X") + " - " +
                                (dwAddr + AddrDesc[i].dwBytes - 1).ToString("X") +
                                " (" + AddrDesc[i].dwBytes.ToString("X") + " bytes)";
                }
                else
                {
                    sAddr[i] += "Inactive address space";
                }
            }
            return(sAddr);
        }
Ejemplo n.º 2
0
        /********************
         *     utilities    *
         *********************/

        /* public methods */

        public string[] AddrDescToString(bool bMemOnly)                     //地址装换输出字符 bar类型 范围和大小
        {
            string[] sAddr = new string[AddrDesc.Length];                   //声明sAddr字符串数组
            for (int i = 0; i < sAddr.Length; ++i)
            {                                                               //dwaddrspace  存储空间代号
                sAddr[i] = "BAR " + AddrDesc[i].dwAddrSpace.ToString() +    //fIsMemory BOOL TRUE: memory address space. FALSE: I/O address space
                           ((AddrDesc[i].fIsMemory)? " Memory " : " I/O "); //

                if (wdc_lib_decl.WDC_AddrSpaceIsActive(Handle,              //判断是否是active 的
                                                       AddrDesc[i].dwAddrSpace))
                {
                    WD_ITEMS item =
                        m_wdcDevice.cardReg.Card.Item[AddrDesc[i].dwItemIndex]; //Card resources information structure. 获得card信息
                    UINT64 dwAddr = (UINT64)(AddrDesc[i].fIsMemory?
                                             item.I.Mem.dwPhysicalAddr : item.I.IO.dwAddr);

                    sAddr[i] += dwAddr.ToString("X") + " - " +
                                (dwAddr + AddrDesc[i].dwBytes - 1).ToString("X") +
                                " (" + AddrDesc[i].dwBytes.ToString("X") + " bytes)";
                }
                else
                {
                    sAddr[i] += "Inactive address space";
                }
            }
            return(sAddr);
        }