Merge pull request #4240 from hp9k/m68kmmu_supervisor_fix

m68kmmu: fix compare of SUPERVISOR_ONLY bit in 8 byte descriptors (nw)
This commit is contained in:
R. Belmont 2018-11-03 17:40:23 -04:00 committed by GitHub
commit a01add15ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,7 +309,7 @@ void update_descriptor(const uint32_t tptr, const int type, const uint32_t entry
}
template<bool _long>
void update_sr(const int type, const uint32_t tbl_entry)
void update_sr(const int type, const uint32_t tbl_entry, const int fc)
{
switch(type)
{
@ -334,7 +334,7 @@ void update_sr(const int type, const uint32_t tbl_entry)
m_mmu_tmp_sr |= M68K_MMU_SR_WRITE_PROTECT;
}
if (_long && (tbl_entry & M68K_MMU_DF_SUPERVISOR))
if (_long && !(fc & 4) && (tbl_entry & M68K_MMU_DF_SUPERVISOR))
{
m_mmu_tmp_sr |= M68K_MMU_SR_SUPERVISOR_ONLY;
}
@ -410,7 +410,7 @@ bool pmmu_walk_tables(uint32_t addr_in, int type, uint32_t table, const int fc,
MMULOG("SHORT DESC: %08x\n", tbl_entry);
table = tbl_entry & M68K_MMU_DF_ADDR_MASK;
update_sr<0>(type, tbl_entry);
update_sr<0>(type, tbl_entry, fc);
if (!ptest)
{
update_descriptor(addr_out, type, tbl_entry, rw);
@ -436,7 +436,7 @@ bool pmmu_walk_tables(uint32_t addr_in, int type, uint32_t table, const int fc,
MMULOG("LONG DESC: %08x %08x\n", tbl_entry, tbl_entry2);
table = tbl_entry2 & M68K_MMU_DF_ADDR_MASK;
update_sr<1>(type, tbl_entry);
update_sr<1>(type, tbl_entry, fc);
if (!ptest)
{
update_descriptor(addr_out, type, tbl_entry, rw);