* 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:
parent
e1f3108a60
commit
59795d428e
@ -125,7 +125,7 @@ compat_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
|
||||
IF_DEQUEUE(&ifp->receive_queue, mb);
|
||||
} 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
|
||||
mb = m_defrag(mb, 0);
|
||||
@ -135,7 +135,7 @@ compat_read(void *cookie, off_t position, void *buffer, size_t *numBytes)
|
||||
}
|
||||
#endif
|
||||
|
||||
memcpy(buffer, mtod(mb, const void *), length);
|
||||
m_copydata(mb, 0, length, buffer);
|
||||
*numBytes = length;
|
||||
|
||||
m_freem(mb);
|
||||
|
@ -641,7 +641,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
|
||||
* Get the physical address for this segment.
|
||||
*/
|
||||
if (pmap)
|
||||
curaddr = pmap_extract(pmap, vaddr);
|
||||
curaddr = (bus_addr_t)pmap_extract(pmap, vaddr);
|
||||
else
|
||||
curaddr = pmap_kextract(vaddr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user