QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Cleaning up after PCI card programming calls |
Ref. No. |
QNX.000009417 |
Category(ies) |
Development |
Issue |
Using QNX4, and programming with Watcom C 10.6. The memory-mapped PCI card has been successfully located and communicated with.
Now, how can I ensure everything is exited from in the proper fashion to avoid any errors or crashes?
|
Solution |
To get to this point, you should have used /dev/shmem to map in the PCI card. Two resources were used for this: one is the fd for the shm_open(), and the second is an area of the process's address space by way of the mmap(). To clean up, this fd needs to closed, and also munmap() the memory that has been mapped.
If a DMA safe memory area was created using qnx_segment_alloc_flags(), it should be freed using qnx_segment_free(). |
|