UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant eng_karim
Participant
2,470 Views
Registered: ‎07-15-2013

illegal instruction with mtcp function

Hi All

 

I am using Zynq-702 board, my applications are running under Linux  while I am trying to execute the following  function (setting the performance monitor control register)

 

                                    mtcp(XREG_CP15_PERF_MONITOR_CTRL, 1)

where

                                     #define mtcp(rn, v) __asm__ __volatile__("mcr "  rn "\n" : : "r" (v0) );

                                     #define XREG_CP_PERF_MONITOR_CTRL "cp15:0:c9:c12:0"

 

I got a message of  illegal instruction while executing it

 

any ideas ??

Thanks

 

 

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
2,465 Views
Registered: ‎03-13-2012

Re: illegal instruction with mtcp function

1. I think Linux uses those counters too. So, with your application and Linux there would be two users for a shared resource. Might not work as expected.

2. I think you can only access those registers from a privileged processor mode. And Linux' userland is not privileged.

 

I don't know the current state of the 'perf' tool for ARM. But that might be the better alternative.

0 Kudos