I found this simple PMU test example for ARM11 family core:
// Example PMU test program for ARM11 family core
//
// This example code is provided "as is", with out warranty
// or support entitlement. No liability is accepted.
// ------------------------------------------------------------
#include <stdio.h>
#include "v6_pmu.h"
int main(void)
{
unsigned int cycle_count, counter0;
enable_pmu(); // Enable the PMU
reset_ccnt(); // Reset the CCNT (cycle counter)
reset_pmn(); // Reset the configurable counters
pmn_config(0, 0x03); // Configure counter 0 to count event
code 0x03
//
// Start of test code
//
printf("hello world\n");
//
// End of test code
//
disable_pmu(); // Stop counters
counter0 = read_pmn(0); // Read counter 0
cycle_count = read_ccnt(); // Read CCNT
printf("Counter 0 = %d, CCNT = %d\n", counter0, cycle_count);
return 0;
}
I have a rooted HTC Hero, whose CPU belongs to ARM11 family and I want
to run this code on it. I have used many times Android NDK to cross-
compile pieces of native code. I am wandering how to do this for such
piece of code.. I only have the v6_pmu.h, but not the v6_pmu.c. Have
someone done it before? Can somebody help me on this?
Thanasis
But I'll give a hint: the code you've posted is from the zip
attachment
of http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/17587.html
which does include the underlying routines. That code is written in
ARM RealView
assembler syntax, not the GNU assembler syntax used by NDK.