阅读:1280回复:10
ARTHURT请进,我需要你的帮助!!!!!!
我现在的pci驱动程序装上以后,从控制面板-〉系统 中看到的我的pci板的信息(内存地址、端口等)是不是真正和我的板子相对应起来了,我是不是对这些地址进行mmmapiospace()便可对内存或端口进行直接操作? :D
[编辑 - 6/10/02 by shengws] [编辑 - 6/10/02 by shengws] [编辑 - 6/10/02 by shengws] |
|
|
沙发#
发布于:2002-06-10 09:05
是。
|
|
板凳#
发布于:2002-06-10 09:23
ARTHURT:那么我想知道,能够看到这些信息,我也能够读出PCI配置空间的内容,是不是能够说明跟硬件端口或内存通讯是可以成功的?
(我现在读内存老是出错死机,用READ(WRITE)_REGISTER_UCHAR),能帮我分析一下原因吗? [编辑 - 6/10/02 by shengws] |
|
|
地板#
发布于:2002-06-10 09:56
是的。
我见到的都是IO space映射的,原因我可猜不出来。 :D 详细点? |
|
地下室#
发布于:2002-06-10 10:06
我先做循环从资源列表读出系统资源,现在读出的是内存的,取的是
U.MEMORY.START,然后MMMAPIOSPACE映射这个东东,然后读写内存READ(WRITE)_REGISTER_UCHAR,机器就死掉了,是不是用读写函数的时候有条件限制? [编辑 - 6/10/02 by shengws] |
|
|
5楼#
发布于:2002-06-10 10:38
看起来好像是对的。
你确定你的设备用了内存映射? Flags Contains bit flags that are specific to the resource type, as indicated in the following table. Flags can be OR\'ed together as appropriate. Resource Type Flag Definition CmResourceTypePort CM_RESOURCE_PORT_MEMORY The device is accessed in memory address space. CM_RESOURCE_PORT_IO The device is accessed in IO address space. CM_RESOURCE_PORT_10_BIT_DECODE The device decodes 10 bits of the port address. CM_RESOURCE_PORT_12_BIT_DECODE The device decodes 12 bits of the port address. CM_RESOURCE_PORT_16_BIT_DECODE The device decodes 16 bits of the port address. CM_RESOURCE_PORT_POSITIVE_DECODE The device uses \"positive decode\" instead of \"subtractive decode\". (In general, PCI devices use positive decode and ISA buses use subtractive decode.) CM_RESOURCE_PORT_PASSIVE_DECODE The device decodes the port but the driver does not use it. CM_RESOURCE_PORT_WINDOW_DECODE Reserved for system use. CmResourceTypeInterrupt CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE The IRQ line is level-triggered. (These IRQs are usually shareable.) CM_RESOURCE_INTERRUPT_LATCHED The IRQ line is edge-triggered. CmResourceTypeMemory CM_RESOURCE_MEMORY_READ_WRITE The memory range is readable and writable. CM_RESOURCE_MEMORY_READ_ONLY The memory range is read-only. CM_RESOURCE_MEMORY_WRITE_ONLY The memory range is write-only. CM_RESOURCE_MEMORY_PREFETCHABLE The memory range is pre-fetchable. CM_RESOURCE_MEMORY_COMBINEDWRITE Combined-write caching is allowed. CM_RESOURCE_MEMORY_24 The device uses 24-bit addressing. CM_RESOURCE_MEMORY_CACHEABLE The memory range is cacheable. CmResourceTypeDma CM_RESOURCE_DMA_8 8-bit DMA channel CM_RESOURCE_DMA_16 16-bit DMA channel CM_RESOURCE_DMA_32 32-bit DMA channel CM_RESOURCE_DMA_8_AND_16 8-bit and 16-bit DMA channel CM_RESOURCE_DMA_BUS_MASTER The device supports bus master DMA transfers. CM_RESOURCE_DMA_TYPE_A Type A DMA CM_RESOURCE_DMA_TYPE_B Type B DMA CM_RESOURCE_DMA_TYPE_F Type F DMA |
|
6楼#
发布于:2002-06-10 11:20
我刚才测了以下资源FLAGS,所得到的结果并不在CM_RESOURCE_MEMORY_READ_WRITE The memory range is readable and writable.
CM_RESOURCE_MEMORY_READ_ONLY The memory range is read-only. CM_RESOURCE_MEMORY_WRITE_ONLY The memory range is write-only. 这3种中间,证明所得内存并不是可读可写的,谢谢你的关心! 那如何我才能将内存变成可读可写,是否需要设置还是? |
|
|
7楼#
发布于:2002-06-10 11:34
关系到PCI配置空间。
问问你的硬件工程师,他是不是对的。 |
|
8楼#
发布于:2002-06-10 17:03
我刚才看了我的PCI配置空间的COMMAND位,它的低两位都是1,我们用的是ACTEL芯片,按照它的说明书,这两位如果是00,它是这样解释的(A VALUE OF \'0\'DISABLES THE DEVICE\'S RESPONSE TO I/O(MEMORY)SPACE ADDRESS),可是我在得到资源里面的FLAGS却和他相反,这东西真是头痛死我了!
|
|
|
9楼#
发布于:2002-06-10 17:17
我的资源类型是
CM_RESOURCE_MEMORY_PREFETCHABLE The memory range is pre-fetchable. 我想知道怎样来操作这种类型的内存空间 |
|
|
10楼#
发布于:2002-06-11 09:39
我也不清楚了,问高手了。 :D
|
|