Performance Measurement reading coprocessor registers


I want to measure the performance of my GSM-EFR speech codec, and for tht i am trying to
read the coprocessor registers using MCR and MRC instructions provided by ARM to read the
cycle count value. But the problem with these instructions is tht they run in the priviledged
mode, hence i am trying to insert a simple module in my kernel in which in the init function,
i want to call the following two assembly instructions.

How will i build such a module having a mix of both C and assembly? How should the MakeFile
look like, am using arm-none-linux-gnueabi- toolchain.?