什么是VxWorks中pciConfigTopoShow()输出中的“preMem”?

时间:2012-09-07 15:57:57

标签: vxworks

对于P2P BRIDGE,pciConfigTopoShow()输出中的'mem'和'preMem'是什么?

这是我的目标的输出......

[1,0,0] type = P2P BRIDGE to [2,0,0]         碱/限制:           mem = 0xa0000000 / 0x9fffffff           preMem = 0x0000000080000000 / 0x00000000800fffff           I / O = 0xe8000000 / 0xe7ffffff         status = 0x0010(CAP DEVSEL = 0)         command = 0x0007(IO_ENABLE MEM_ENABLE MASTER_ENABLE) [2,1,0] type = P2P BRIDGE to [3,0,0]         碱/限制:           mem = 0xa0000000 / 0x9fffffff           preMem = 0x0000000080000000 / 0x00000000800fffff           I / O = 0xe8000000 / 0xe7ffffff         status = 0x0010(CAP DEVSEL = 0)         command = 0x0007(IO_ENABLE MEM_ENABLE MASTER_ENABLE) [3,0,0] type = P2P BRIDGE to [4,0,0]         碱/限制:           mem = 0xa0000000 / 0x9fffffff           preMem = 0x80100000 / 0x800fffff           I / O = 0x0000 / 0xffff         status = 0x0010(CAP DEVSEL = 0)         command = 0x0007(IO_ENABLE MEM_ENABLE MASTER_ENABLE)         bar0在可预取的64位内存空间@ 0x80000000

1 个答案:

答案 0 :(得分:0)

“mem”和“preMem”值是通过多层函数调用从pciConfigTopoShow()函数生成的。 “mem”用于为桥映射的正常内存窗口,分别显示内存基数和内存限制,用“/".

分隔

如果设备支持,则“preMem”用于预取内存窗口,显示该设备的内存基数和内存限制。如果它是64位计算机,则这些值显示为64位数量。

最终,在WIND_BASE / target / src / drv / pci / pciConfigShow.c文件中找到的pciConfigForeachShow()函数会在以下代码片段中生成与您的问题一起显示的输出:

if ( cmdReg & PCI_CMD_MEM_ENABLE )

{

     pciConfigInWord(bus,device,function,

                     PCI_CFG_MEM_BASE, &memBase);

     pciConfigInWord(bus,device,function,

                     PCI_CFG_MEM_LIMIT, &memLimit);

     printf("\tbase/limit:\n");

     printf("\t  mem=   0x%04x0000/0x%04xffff\n",

                 memBase & 0xfff0, memLimit | 0x000f);



     pciConfigInWord(bus,device,function,

                     PCI_CFG_PRE_MEM_BASE, &memBase);

     pciConfigInWord(bus,device,function,

                     PCI_CFG_PRE_MEM_LIMIT, &memLimit);

     if ( ( memBase & 0x000f ) == 0x0001 )

     {

         /* 64-bit memory */

         pciConfigInLong(bus,device,function,

                         PCI_CFG_PRE_MEM_BASE_U,

                         &memBaseU);

         pciConfigInLong(bus,device,function,

                         PCI_CFG_PRE_MEM_LIMIT_U,

                         &memLimitU);

         printf("\t  preMem=0x%08x%04x0000/"

                     "0x%08x%04xffff\n",

                      memBaseU, memBase & 0xfff0,

                      memLimitU, memLimit | 0x000f);

     }

     else

         printf("\t  preMem=0x%04x0000/0x%04xffff\n",

                     memBase & 0xfff0, memLimit | 0x000f);

     }