VirtualBox

Ignore:
Timestamp:
Mar 15, 2007 2:57:05 PM (18 years ago)
Author:
vboxsync
Message:

Update eip for each instruction. (makes it easier to generate exceptions)
Re-enabled null selector check during memory accesses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/translate.c

    r1478 r1514  
    833833    gen_op_check_external_event();
    834834}
     835
     836static inline void gen_update_eip(target_ulong pc)
     837{
     838#ifdef TARGET_X86_64
     839    if (pc == (uint32_t)pc) {
     840        gen_op_movl_eip_im(pc);
     841    } else if (pc == (int32_t)pc) {
     842        gen_op_movq_eip_im(pc);
     843    } else {
     844        gen_op_movq_eip_im64(pc >> 32, pc);
     845    }
     846#else
     847    gen_op_movl_eip_im(pc);
     848#endif
     849}
     850
    835851#endif /* VBOX */
    836852
     
    839855#ifdef VBOX
    840856    gen_check_external_event();
    841 #endif /* VBOX */
     857#endif
    842858#ifdef TARGET_X86_64
    843859    if (pc == (uint32_t)pc) {
     
    31343150#endif
    31353151    s->rip_offset = 0; /* for relative ip address */
     3152
     3153#ifdef VBOX
     3154    /* Always update EIP. Otherwise one must be very careful with generated code that can raise exceptions. */
     3155    gen_update_eip(pc_start - s->cs_base);
     3156#endif
     3157
    31363158 next_byte:
    31373159    b = ldub_code(s->pc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette