mirror of
				https://github.com/yuzu-emu/unicorn.git
				synced 2025-11-04 10:24:53 +00:00 
			
		
		
		
	target/m68k: use EXCP_ILLEGAL instead of EXCP_UNSUPPORTED
Coldfire defines an "Unsupported instruction" exception if execution of a valid instruction is attempted but the required hardware is not present in the processor. We use it with instructions that are in fact undefined or illegal, and the exception expected in this case by the kernel is the illegal exception, so this patch fixes that. Backports commit b9f8e55bf7e994e192ab7360830731580384b813 from qemu
This commit is contained in:
		
							parent
							
								
									800c9db9c9
								
							
						
					
					
						commit
						26d8891d1b
					
				| 
						 | 
					@ -71,7 +71,6 @@
 | 
				
			||||||
#define EXCP_MMU_CONF       56  /* MMU Configuration Error */
 | 
					#define EXCP_MMU_CONF       56  /* MMU Configuration Error */
 | 
				
			||||||
#define EXCP_MMU_ILLEGAL    57  /* MMU Illegal Operation Error */
 | 
					#define EXCP_MMU_ILLEGAL    57  /* MMU Illegal Operation Error */
 | 
				
			||||||
#define EXCP_MMU_ACCESS     58  /* MMU Access Level Violation Error */
 | 
					#define EXCP_MMU_ACCESS     58  /* MMU Access Level Violation Error */
 | 
				
			||||||
#define EXCP_UNSUPPORTED    61
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define EXCP_RTE            0x100
 | 
					#define EXCP_RTE            0x100
 | 
				
			||||||
#define EXCP_HALT_INSN      0x101
 | 
					#define EXCP_HALT_INSN      0x101
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1592,7 +1592,7 @@ DISAS_INSN(undef)
 | 
				
			||||||
       but actually illegal for CPU32 or pre-68020.  */
 | 
					       but actually illegal for CPU32 or pre-68020.  */
 | 
				
			||||||
    qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x\n",
 | 
					    qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x\n",
 | 
				
			||||||
                  insn, s->base.pc_next);
 | 
					                  insn, s->base.pc_next);
 | 
				
			||||||
    gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED);
 | 
					    gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DISAS_INSN(mulw)
 | 
					DISAS_INSN(mulw)
 | 
				
			||||||
| 
						 | 
					@ -2891,7 +2891,7 @@ DISAS_INSN(mull)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (ext & 0x400) {
 | 
					    if (ext & 0x400) {
 | 
				
			||||||
        if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) {
 | 
					        if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) {
 | 
				
			||||||
            gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED);
 | 
					            gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4690,7 +4690,7 @@ DISAS_INSN(strldsr)
 | 
				
			||||||
    addr = s->pc - 2;
 | 
					    addr = s->pc - 2;
 | 
				
			||||||
    ext = read_im16(env, s);
 | 
					    ext = read_im16(env, s);
 | 
				
			||||||
    if (ext != 0x46FC) {
 | 
					    if (ext != 0x46FC) {
 | 
				
			||||||
        gen_exception(s, addr, EXCP_UNSUPPORTED);
 | 
					        gen_exception(s, addr, EXCP_ILLEGAL);
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    ext = read_im16(env, s);
 | 
					    ext = read_im16(env, s);
 | 
				
			||||||
| 
						 | 
					@ -4978,7 +4978,7 @@ DISAS_INSN(wdebug)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    /* TODO: Implement wdebug.  */
 | 
					    /* TODO: Implement wdebug.  */
 | 
				
			||||||
    qemu_log("WDEBUG not implemented\n");
 | 
					    qemu_log("WDEBUG not implemented\n");
 | 
				
			||||||
    gen_exception(s, s->pc - 2, EXCP_UNSUPPORTED);
 | 
					    gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue