196 you need to adopt the technique suggested below. The local media subsystem |
196 you need to adopt the technique suggested below. The local media subsystem |
197 will make the physical address available to the media driver. A call to <xref href="GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C.dita#GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C/GUID-DD6773B4-9EF5-322F-B53D-29174DF3B3BF"><apiname>TLocDrvRequest::IsPhysicalAddress()</apiname></xref> returns |
197 will make the physical address available to the media driver. A call to <xref href="GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C.dita#GUID-D84A9903-AE0F-3F54-8833-E8956A88E26C/GUID-DD6773B4-9EF5-322F-B53D-29174DF3B3BF"><apiname>TLocDrvRequest::IsPhysicalAddress()</apiname></xref> returns |
198 true. </p> <p>Consider the following case. A request has been made to read |
198 true. </p> <p>Consider the following case. A request has been made to read |
199 1024 bytes from a media device that has a block size of 512 bytes. The 1024 |
199 1024 bytes from a media device that has a block size of 512 bytes. The 1024 |
200 bytes start at offset +256 on the media device. </p> <fig id="GUID-2689C022-180B-51EF-A02D-E63ACA832EB2"> |
200 bytes start at offset +256 on the media device. </p> <fig id="GUID-2689C022-180B-51EF-A02D-E63ACA832EB2"> |
201 <image href="GUID-647ADEDA-AB5A-548F-93C3-D099EAE6A030_d0e411447_href.png" placement="inline"/> |
201 <image href="GUID-647ADEDA-AB5A-548F-93C3-D099EAE6A030_d0e409270_href.png" placement="inline"/> |
202 </fig> <p>To get the first 256 bytes, you must read the first block of 512 |
202 </fig> <p>To get the first 256 bytes, you must read the first block of 512 |
203 bytes from the media device. This can corrupt the physical memory passed in |
203 bytes from the media device. This can corrupt the physical memory passed in |
204 the I/O request. The solution is to read the first block from the media device |
204 the I/O request. The solution is to read the first block from the media device |
205 into an intermediate buffer. Copy the 256 bytes from that buffer into the |
205 into an intermediate buffer. Copy the 256 bytes from that buffer into the |
206 physical memory passed in the I/O request. </p> <p>To get the last 256 bytes, |
206 physical memory passed in the I/O request. </p> <p>To get the last 256 bytes, |