mirror of https://github.com/xqemu/xqemu.git
Alignment check mechanism (not fully enabled yet) (Aurelien Jarno)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2655 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
24be5ae3a0
commit
d2889a3efc
|
@ -35,6 +35,7 @@
|
||||||
#define TT_NFPU_INSN 0x04
|
#define TT_NFPU_INSN 0x04
|
||||||
#define TT_WIN_OVF 0x05
|
#define TT_WIN_OVF 0x05
|
||||||
#define TT_WIN_UNF 0x06
|
#define TT_WIN_UNF 0x06
|
||||||
|
#define TT_UNALIGNED 0x07
|
||||||
#define TT_FP_EXCP 0x08
|
#define TT_FP_EXCP 0x08
|
||||||
#define TT_DFAULT 0x09
|
#define TT_DFAULT 0x09
|
||||||
#define TT_TOVF 0x0a
|
#define TT_TOVF 0x0a
|
||||||
|
@ -55,6 +56,7 @@
|
||||||
#define TT_DFAULT 0x30
|
#define TT_DFAULT 0x30
|
||||||
#define TT_DMISS 0x31
|
#define TT_DMISS 0x31
|
||||||
#define TT_DPROT 0x32
|
#define TT_DPROT 0x32
|
||||||
|
#define TT_UNALIGNED 0x34
|
||||||
#define TT_PRIV_ACT 0x37
|
#define TT_PRIV_ACT 0x37
|
||||||
#define TT_EXTINT 0x40
|
#define TT_EXTINT 0x40
|
||||||
#define TT_SPILL 0x80
|
#define TT_SPILL 0x80
|
||||||
|
|
|
@ -1486,6 +1486,9 @@ void OPPROTO op_movl_npc_im(void)
|
||||||
|
|
||||||
void OPPROTO op_movl_npc_T0(void)
|
void OPPROTO op_movl_npc_T0(void)
|
||||||
{
|
{
|
||||||
|
if (T0 & 0x3)
|
||||||
|
raise_exception(TT_UNALIGNED);
|
||||||
|
else
|
||||||
env->npc = T0;
|
env->npc = T0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -923,7 +923,11 @@ void do_interrupt(int intno)
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
|
||||||
|
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
|
void *retaddr);
|
||||||
|
|
||||||
#define MMUSUFFIX _mmu
|
#define MMUSUFFIX _mmu
|
||||||
|
#define ALIGNED_ONLY
|
||||||
#define GETPC() (__builtin_return_address(0))
|
#define GETPC() (__builtin_return_address(0))
|
||||||
|
|
||||||
#define SHIFT 0
|
#define SHIFT 0
|
||||||
|
@ -938,6 +942,14 @@ void do_interrupt(int intno)
|
||||||
#define SHIFT 3
|
#define SHIFT 3
|
||||||
#include "softmmu_template.h"
|
#include "softmmu_template.h"
|
||||||
|
|
||||||
|
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
|
||||||
|
void *retaddr)
|
||||||
|
{
|
||||||
|
/* Uncomment the following line to enable mem_address_not_aligned traps */
|
||||||
|
/* Not enabled yet because of bugs in OpenBIOS */
|
||||||
|
//raise_exception(TT_UNALIGNED);
|
||||||
|
//printf("Unaligned access to 0x%x from 0x%x\n", addr, env->pc);
|
||||||
|
}
|
||||||
|
|
||||||
/* try to fill the TLB and return an exception if error. If retaddr is
|
/* try to fill the TLB and return an exception if error. If retaddr is
|
||||||
NULL, it means that the function was called in C code (i.e. not
|
NULL, it means that the function was called in C code (i.e. not
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
Rest of V9 instructions, VIS instructions
|
Rest of V9 instructions, VIS instructions
|
||||||
NPC/PC static optimisations (use JUMP_TB when possible)
|
NPC/PC static optimisations (use JUMP_TB when possible)
|
||||||
Optimize synthetic instructions
|
Optimize synthetic instructions
|
||||||
Optional alignment check
|
|
||||||
128-bit float
|
128-bit float
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue