<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: execute asm from linux user space in PowerQUICC Processors</title>
    <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313009#M697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe if you tell us what you're trying to do we find out a solution/work-around for you. Basically, for a normal application in user space, you shouldn't need any MSR instructions and let the kernel make this for you (you can use some system calls for this - I'm not very familiar with the SDK and I don;t know if these system calls already exists for MSR, but I'm pretty sure you can define all these). Maybe somebody from SDK team can help better than me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2014 12:07:11 GMT</pubDate>
    <dc:creator>marius_grigoras</dc:creator>
    <dc:date>2014-04-09T12:07:11Z</dc:date>
    <item>
      <title>execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313006#M694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;I have written simple program and compile with all environment settings which are mentioned in SDK. But still getting error as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;STRONG style="color: #1f497d;"&gt;Illegal instruction&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;STRONG style="color: #1f497d;"&gt;/opt/fsl-networking/QorIQ-SDK-V1.5/sysroots/i686-fsl_networking_sdk-linux/usr/bin/ppce5500-fsl_networking-linux/powerpc-fsl_networking-linux-gcc asm.c -o myasm&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;static inline int ppc_get_msr (void)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; int value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; asm volatile ("mfmsr %0" : "=r" (value));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; return (value);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;int main()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; unsigned int value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; value =&amp;nbsp; ppc_get_msr();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt; printf("value:%x\n",value);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #1f497d;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 10:49:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313006#M694</guid>
      <dc:creator>ramakrishnakatt</dc:creator>
      <dc:date>2014-04-09T10:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313007#M695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that you can't play with mfmsr and mtmsr instructions in user space (these are privileged instructions) - you can use these in a bare-board code (like u-boot for example) or directly in kernel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 11:14:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313007#M695</guid>
      <dc:creator>marius_grigoras</dc:creator>
      <dc:date>2014-04-09T11:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313008#M696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are working on Diag tool, earlier it is based on non-os. Now it is moved to Linux, so we want to use same code in user space. This is mandatory for us other wise we have to rewrite much code. Please suggest some solution to execute this from user space&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 11:18:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313008#M696</guid>
      <dc:creator>ramakrishnakatt</dc:creator>
      <dc:date>2014-04-09T11:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313009#M697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe if you tell us what you're trying to do we find out a solution/work-around for you. Basically, for a normal application in user space, you shouldn't need any MSR instructions and let the kernel make this for you (you can use some system calls for this - I'm not very familiar with the SDK and I don;t know if these system calls already exists for MSR, but I'm pretty sure you can define all these). Maybe somebody from SDK team can help better than me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 12:07:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313009#M697</guid>
      <dc:creator>marius_grigoras</dc:creator>
      <dc:date>2014-04-09T12:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313010#M698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are no system calls for manipulating MSR, nor should there be.&amp;nbsp; There's a reason that it is a privileged register.&amp;nbsp; If userspace could arbitrarily alter MSR, it could disable interrupts and hang the core.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 22:11:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313010#M698</guid>
      <dc:creator>scottwood</dc:creator>
      <dc:date>2014-04-14T22:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: execute asm from linux user space</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313011#M699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, it's not possible.&amp;nbsp; What is the code trying to accomplish with MSR?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2014 22:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/execute-asm-from-linux-user-space/m-p/313011#M699</guid>
      <dc:creator>scottwood</dc:creator>
      <dc:date>2014-04-14T22:13:18Z</dc:date>
    </item>
  </channel>
</rss>

