<div dir="ltr"><div>I tried compiling this but I get slightly different error:<br><br> error: can’t find a register in class ‘CREG’ while reloading ‘asm’<br><br>this error is because of explicit clobber list which is not needed in this case as all registers in clobber list are input list.<br>
</div><div>Note that it is CREG because it encounter "cx" in clobber list first.<br></div><div><br></div>-Rajat<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 27, 2013 at 1:21 PM, lx <span dir="ltr"><<a href="mailto:lxlenovostar@gmail.com" target="_blank">lxlenovostar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi all:<div> The codes is:</div><div><div>static int match(int len,const char * name,struct dir_entry * de)</div>
<div>{</div><div> register int same __asm__("ax");</div><div><br></div><div> if (!de || !de->inode || len > NAME_LEN)</div>
<div> return 0;</div><div> if (len < NAME_LEN && de->name[len])</div><div> return 0;</div><div> <b>__asm__ ("cld\n\t"</b></div><div> "fs ; repe ; cmpsb\n\t"</div>
<div> "setz %%al"</div><div> :"=a" (same)</div><div> :"0" (0),"S" ((long) name),"D" ((long) de->name),"c" (len)</div>
<div> :"cx","di","si");</div><div> return same;</div><div>}</div></div><div><br></div><div>When I make it, the error messages is:</div><div><b>namei.c:35: error: can't find a register in class ‘AREG’ while reloading ‘asm’</b></div>
<div><b><br></b></div><div><b>This is why? </b></div><div><b>Thank you</b></div><div><br></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>