* Applied patch by Adrian: compat_read() was broken as it only considered the
first chunk of a possibly multi-buffer mbuf. This fixes #2840, thanks a lot! * Fixed warning in _bus_dmamap_load_buffer(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28599 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -125,7 +125,7 @@ compat_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
|
|||||||
IF_DEQUEUE(&ifp->receive_queue, mb);
|
IF_DEQUEUE(&ifp->receive_queue, mb);
|
||||||
} while (mb == NULL);
|
} while (mb == NULL);
|
||||||
|
|
||||||
length = min_c(max_c((size_t)mb->m_len, 0), *numBytes);
|
length = min_c(max_c((size_t)mb->m_pkthdr.len, 0), *numBytes);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
mb = m_defrag(mb, 0);
|
mb = m_defrag(mb, 0);
|
||||||
@@ -135,7 +135,7 @@ compat_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memcpy(buffer, mtod(mb, const void *), length);
|
m_copydata(mb, 0, length, buffer);
|
||||||
*numBytes = length;
|
*numBytes = length;
|
||||||
|
|
||||||
m_freem(mb);
|
m_freem(mb);
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
|||||||
* Get the physical address for this segment.
|
* Get the physical address for this segment.
|
||||||
*/
|
*/
|
||||||
if (pmap)
|
if (pmap)
|
||||||
curaddr = pmap_extract(pmap, vaddr);
|
curaddr = (bus_addr_t)pmap_extract(pmap, vaddr);
|
||||||
else
|
else
|
||||||
curaddr = pmap_kextract(vaddr);
|
curaddr = pmap_kextract(vaddr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user