reios: fix wince exception due to unaligned pio xfer
This commit is contained in:
parent
2e77e049a8
commit
5ca6cacf25
|
@ -191,9 +191,7 @@ void mmu_raise_exception(u32 mmu_error, u32 address, u32 am)
|
|||
RaiseException(0x40, 0x400);
|
||||
else //ITLBMISS - Instruction TLB Miss Exception
|
||||
RaiseException(0x40, 0x400);
|
||||
|
||||
return;
|
||||
break;
|
||||
|
||||
//TLB Multihit
|
||||
case MMU_ERROR_TLB_MHIT:
|
||||
|
@ -212,7 +210,6 @@ void mmu_raise_exception(u32 mmu_error, u32 address, u32 am)
|
|||
verify(false);
|
||||
}
|
||||
return;
|
||||
break;
|
||||
|
||||
//Mem is write protected , firstwrite
|
||||
case MMU_ERROR_FIRSTWRITE:
|
||||
|
@ -220,16 +217,20 @@ void mmu_raise_exception(u32 mmu_error, u32 address, u32 am)
|
|||
verify(am == MMU_TT_DWRITE);
|
||||
//FIRSTWRITE - Initial Page Write Exception
|
||||
RaiseException(0x80, 0x100);
|
||||
|
||||
return;
|
||||
break;
|
||||
|
||||
//data read/write missasligned
|
||||
case MMU_ERROR_BADADDR:
|
||||
if (am == MMU_TT_DWRITE) //WADDERR - Write Data Address Error
|
||||
{
|
||||
printf_mmu("MMU_ERROR_BADADDR(dw) 0x%X", address);
|
||||
RaiseException(0x100, 0x100);
|
||||
}
|
||||
else if (am == MMU_TT_DREAD) //RADDERR - Read Data Address Error
|
||||
{
|
||||
printf_mmu("MMU_ERROR_BADADDR(dr) 0x%X", address);
|
||||
RaiseException(0xE0, 0x100);
|
||||
}
|
||||
else //IADDERR - Instruction Address Error
|
||||
{
|
||||
#ifdef TRACE_WINCE_SYSCALLS
|
||||
|
@ -237,11 +238,8 @@ void mmu_raise_exception(u32 mmu_error, u32 address, u32 am)
|
|||
#endif
|
||||
printf_mmu("MMU_ERROR_BADADDR(i) 0x%X", address);
|
||||
RaiseException(0xE0, 0x100);
|
||||
return;
|
||||
}
|
||||
printf_mmu("MMU_ERROR_BADADDR(d) 0x%X, handled", address);
|
||||
return;
|
||||
break;
|
||||
|
||||
//Can't Execute
|
||||
case MMU_ERROR_EXECPROT:
|
||||
|
@ -250,7 +248,6 @@ void mmu_raise_exception(u32 mmu_error, u32 address, u32 am)
|
|||
//EXECPROT - Instruction TLB Protection Violation Exception
|
||||
RaiseException(0xA0, 0x100);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
die("Unknown mmu_error");
|
||||
|
|
|
@ -173,7 +173,7 @@ static void multi_xfer()
|
|||
while (size > 0)
|
||||
{
|
||||
int remaining = 2048 - gd_hle_state.multi_read_offset;
|
||||
if (size >= 4 && remaining >= 4)
|
||||
if (size >= 4 && remaining >= 4 && (dest & 3) == 0)
|
||||
{
|
||||
if (dma)
|
||||
WriteMem32_nommu(dest, *(u32*)&buf[gd_hle_state.multi_read_offset]);
|
||||
|
@ -184,7 +184,7 @@ static void multi_xfer()
|
|||
gd_hle_state.multi_read_count -= 4;
|
||||
size -= 4;
|
||||
}
|
||||
else if (size >= 2 && remaining >= 2)
|
||||
else if (size >= 2 && remaining >= 2 && (dest & 1) == 0)
|
||||
{
|
||||
if (dma)
|
||||
WriteMem16_nommu(dest, *(u16*)&buf[gd_hle_state.multi_read_offset]);
|
||||
|
|
Loading…
Reference in New Issue