<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 4, 2016, at 11:59 PM, Dave Tian &lt;<a href="mailto:dave.jing.tian@gmail.com" class="">dave.jing.tian@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">This ‘P’ is used to make gcc happy and work.</div><div class="">Without ‘P’, this inline would be interpreted as:</div><div class="">leal $-512(%esp), %eax</div><div class="">With ‘P’, this inline is the thing we really want:</div><div class="">leal -512(%esp), %eax</div><div class=""><br class=""></div><div class="">Eventually, my gcc 4.9.2 does not compile with ‘P’ is missing. I am not sure if this is still the case for newer gcc (5/6). But you get the point.</div><div class=""><br class=""></div><div class="">-daveti</div><div class=""><br class=""></div></div></div></div></blockquote><div><br class=""></div>Thank you for your detailed answer !</div><div><br class=""></div><div>By the way, If someone have the problems alike, I suggest them to write some inline assembly and check the compiler’s assembly output.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 4, 2016, at 7:36 AM, 张云 &lt;<a href="mailto:zyunone@163.com" class="">zyunone@163.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi</div><div class=""><br class=""></div>In /arch/x86/boot/main.c &nbsp;(<a href="http://lxr.free-electrons.com/source/arch/x86/boot/main.c" class="">http://lxr.free-electrons.com/source/arch/x86/boot/main.c</a>) ,<div class=""><br class=""><div class="">In the function init_heap,</div><pre style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 14px; padding: 1em; color: rgb(120, 120, 120); background-color: rgb(255, 255, 255); overflow: auto; font-weight: bold;" class="">asm(<i class="">"leal %P1(%%esp),%0"</i>
<a name="L122" href="http://lxr.free-electrons.com/source/arch/x86/boot/source/arch/x86/boot/main.c#L122" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153);" class="">122</a>                     : <i class="">"=r"</i> (stack_end) : <i class="">"i"</i> (-<a href="http://lxr.free-electrons.com/source/arch/x86/boot/ident?i=STACK_SIZE" style="text-decoration: none; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(153, 153, 153);" class="">STACK_SIZE</a>));</pre><div class="">&nbsp;What does the ‘%P1’ mean in the inline assembly above ?</div><div class=""><br class=""></div></div><div class="">Thanks !</div></div>_______________________________________________<br class="">Kernelnewbies mailing list<br class=""><a href="mailto:Kernelnewbies@kernelnewbies.org" class="">Kernelnewbies@kernelnewbies.org</a><br class=""><a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" class="">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br class=""></div></blockquote></div><br class=""></div>_______________________________________________<br class="">Kernelnewbies mailing list<br class=""><a href="mailto:Kernelnewbies@kernelnewbies.org" class="">Kernelnewbies@kernelnewbies.org</a><br class="">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br class=""></div></blockquote></div><br class=""></body></html>