Re: gcc-4 inline assembler question (no register in class 'GENERAL_REGS' error)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enrico Scholz wrote:
>   asm("    fs movl %0, %%eax\n"
>       "    fs movl %1, %%ebx\n"
>       "    fs movl %2, %%ecx\n"
>       "    fs movl %3, %%edx\n"
>       "    fs movl %4, %%esp\n"
>       "    fs movl %5, %%ebp\n"
>       "    fs movl %6, %%esi\n"   // **
>       :
>       : "m" (Xoffsetof(CPUState, regs[0])),
> 	"m" (Xoffsetof(CPUState, regs[1])),
> 	"m" (Xoffsetof(CPUState, regs[2])),
> 	"m" (Xoffsetof(CPUState, regs[3])),
> 	"m" (Xoffsetof(CPUState, regs[4])),
> 	"m" (Xoffsetof(CPUState, regs[5])), // **
> 	"m" (Xoffsetof(CPUState, regs[6]))

This form is calling for trouble anyway.  Just use the following which
should work well with older gcc versions as well:

  asm("    fs movl %c0, %%eax\n"
      "    fs movl %c1, %%ebx\n"
      "    fs movl %c2, %%ecx\n"
      "    fs movl %c3, %%edx\n"
      "    fs movl %c4, %%esp\n"
      "    fs movl %c5, %%ebp\n"
      "    fs movl %c6, %%esi\n"
      :
      : "i" (offsetof(CPUState, regs[0])),
        "i" (offsetof(CPUState, regs[1])),
        "i" (offsetof(CPUState, regs[2])),
        "i" (offsetof(CPUState, regs[3])),
        "i" (offsetof(CPUState, regs[4])),
        "i" (offsetof(CPUState, regs[5])),
        "i" (offsetof(CPUState, regs[6]))
    );


-- 
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
http://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux