02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

SHARED_POINTERS Attribute<br />

This attribute is only a problem if the memory shared between the driver and the<br />

device was obtained using the cacheDmaMalloc( ) routine. Because this routine<br />

can invoke MMU or other special hardware services, the address of the provided<br />

memory can be a virtual address. The device, however, can deal only in physical<br />

addresses.<br />

In this case, use the CACHE_DMA_VIRT_TO_PHYS and<br />

CACHE_DMA_PHYS_TO_VIRT macros to convert between driver-viewed<br />

addresses and device-viewed addresses.<br />

5.8.4 Additional Cache Library Hints<br />

Here are some additional hints for using the cache library:<br />

■<br />

■<br />

Before adding any cacheLib support to your driver, ensure that the driver<br />

works reliably with the data cache turned off. You will not experience cache<br />

coherency problems with the data cache disabled. When you begin to add<br />

cacheLib support, you can enable the data cache. Any changes to the driver’s<br />

reliability can then be attributed to cache issues.<br />

Ensure that the driver works with cacheLib support on a single target first,<br />

using target-specific knowledge to guide the strategy. When this has been<br />

achieved, you can then modify the driver’s cacheLib strategy for broader,<br />

target-independent support.<br />

110

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!