lkml.org 
[lkml]   [2004]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: i486 emu in mainline?
    On Sun, 23 May 2004, Christoph Hellwig wrote:

    > + /* we'll verify if this is a BSWAP opcode, main source of SIGILL on 386's */
    > + if ((*eip & 0xF8) == 0xC8) { /* BSWAP */
    > + u8 reg;
    > +
    > + reg = *eip++ & 0x07;
    > + src = reg_address(regs, 1, reg);
    > +
    > + __asm__ __volatile__ (
    > + "xchgb %%al, %%ah\n\t"
    > + "roll $16, %%eax\n\t"
    > + "xchgb %%al, %%ah\n\t"
    > + : "=a" (*(u32*)src)
    > + : "a" (*(u32*)src));
    > + regs->eip = (u32)eip;
    > + goto out;
    > + }

    You've forgotten about the 16-bit variant here -- the emulation is wrong
    with PREFIX_D32. This may not matter much in practice, though.

    --
    + Maciej W. Rozycki, Technical University of Gdansk, Poland +
    +--------------------------------------------------------------+
    + e-mail: macro@ds2.pg.gda.pl, PGP key available +
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 14:03    [from the cache]
    ©2003-2014 Jasper Spaans. Advertise on this site