VxWorks 653을 사용하고 있으며 대상은 wrSbc7457 Power PC입니다.VxWorks 653에서 PCI 장치의 메모리 읽기/쓰기는 어떻게 하나입니까?
내 wrSbc7457에 메 자닌 카드가 있는데 그 메 자닌 카드에 메모리를 쓰거나 읽으려고합니다. VxWorks를 잘 알고 당신의 사람들을 위해
, 나는 내 ModuleOS의usrAppInit()
기능에 다음과 같은 한 :
printf ("Entering ModuleOS, usrAppInit() ...\n") ;
printf ("sysModel() returns %s\n", sysModel()) ;
pciDeviceShow (0) ;
{
int pciBus, pciDevice, pciFunc ;
UINT32 BAR_0_contents, BAR_1_contents ;
printf
("\npciFindDevice returns STATUS %d\n",
pciFindDevice (my_VENDORID, my_PMC_DEVICEID, 0, &pciBus, &pciDevice, &pciFunc)
) ;
printf ("\tand pciBus = %d, pciDevice = %d, pciFunc = %d\n", pciBus, pciDevice, pciFunc) ;
printf ("\npciConfigInLong returns STATUS %d\n",
pciConfigInLong (pciBus, pciDevice, pciFunc, PCI_CFG_BASE_ADDRESS_0, & BAR_0_contents)) ;
printf ("\tand Base Address Register 0 contains 0x%X\n", BAR_0_contents) ;
printf ("\npciConfigInLong returns STATUS %d\n",
pciConfigInLong (pciBus, pciDevice, pciFunc, PCI_CFG_BASE_ADDRESS_1, & BAR_1_contents)) ;
printf ("\tand Base Address Register 1 contains 0x%X\n", BAR_1_contents) ;
내 목표는 OS 부팅 이미지를로드 할 때 다음과 같은 출력 :
Entering ModuleOS, usrAppInit() ...
sysModel() returns wrSbc7457 Power PC
Scanning function 0 of each PCI device on bus 0
Using configuration mechanism 0
bus device function vendorID deviceID class
00000000 00000000 00000000 0000---- 0000---- 000-----
00000000 00000001 00000000 0000---- 0000---- 00--0000
00000000 00000002 00000000 0000---- 0000---- 000-----
pciFindDevice returns STATUS 0 (OK)
and pciBus = 0, pciDevice = 1, pciFunc = 0
pciConfigInLong returns STATUS 0 (OK)
and Base Address Register 0 contains 0x50000000
pciConfigInLong returns STATUS 0 (OK)
and Base Address Register 1 contains 0x58000000
제 질문은 : 어떻게 내 메 자닌 카드의 메모리를 호스트의 주소 공간에 매핑합니까? 그런 다음 메 자닌 카드에 메모리를 쓰거나 읽는 방법은 무엇입니까?