How do I access my memory mapped I/O Device (FPGA) from a RTP in VxWorks?

不打扰是莪最后的温柔 提交于 2019-12-22 12:27:07

问题


When using VxWorks, we are trying to access a memory mapped I/O device from a Real-Time Process.
Since RTPs have memory protection, how can I access my I/O device from one?


回答1:


There are two methods you can use to access your I/O mapped device from an RTP.

I/O Subsystem (preferred)

You essentially create a small device driver. This driver can be integrated into the I/O Subsystem of VxWorks. Once integrated, the driver is available to the RTP by simply using standard I/O operations: open, close, read, write, ioctl.

Note that "creating a device driver" doesn't have to be complicated. It could be as simple as just defining a wrapper for the ioctl function. See ioLib for more details.

Map Memory Directly (not recommended)

You can create a shared memory region via the sdOpen call. When creating the shared memory, you can specify what the physical address should be. Specify the address to be your device's I/O mapped region, and you can access the device directly.

The problem is that a shared memory region is a public object that is available to any space, and poking directly at hardware goes against the philosophy behind RTPs.



来源:https://stackoverflow.com/questions/113001/how-do-i-access-my-memory-mapped-i-o-device-fpga-from-a-rtp-in-vxworks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!