Fix bad SHM reads of ranges above 1MB.

develop
Petr Mrázek 2010-05-26 18:05:12 +02:00
parent af1a41712e
commit bd4456b5f6
2 changed files with 3 additions and 3 deletions

@ -609,7 +609,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff
else else
{ {
// first read equals the size of the SHM window // first read equals the size of the SHM window
uint32_t to_read = SHM_BODY - 1024; uint32_t to_read = SHM_BODY;
while (size) while (size)
{ {
// read to_read bytes from src_cursor // read to_read bytes from src_cursor
@ -617,7 +617,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff
D_SHMHDR->length = to_read; D_SHMHDR->length = to_read;
gcc_barrier gcc_barrier
d->SetAndWait(CORE_READ); d->SetAndWait(CORE_READ);
memcpy (target_buffer, D_SHMDATA(void) ,size); memcpy (target_buffer, D_SHMDATA(void) ,to_read);
// decrease size by bytes read // decrease size by bytes read
size -= to_read; size -= to_read;
// move the cursors // move the cursors

@ -678,7 +678,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff
D_SHMHDR->length = to_read; D_SHMHDR->length = to_read;
full_barrier full_barrier
d->SetAndWait(CORE_READ); d->SetAndWait(CORE_READ);
memcpy (target_buffer, D_SHMDATA(void) ,size); memcpy (target_buffer, D_SHMDATA(void) ,to_read);
// decrease size by bytes read // decrease size by bytes read
size -= to_read; size -= to_read;
// move the cursors // move the cursors