From OMAPpedia
%{
#include <../arch/arm/include/asm/io.h>
%}
%{
#if defined(OMAP_L23)
#include <../arch/arm/plat-omap/include/plat/omap34xx.h>
#elif defined(OMAP_L25)
#include <../arch/arm/plat-omap/include/mach/io.h>
#elif defined(OMAP_L24) || defined(OMAP_L27)
#include <../arch/arm/plat-omap/include/plat/io.h>
#else
#error " OMAP RELEASE FAMILY IS NOT SPECIFIED => add -D OMAP_L23 for eg when compiling the script"
#endif
%}
function get_32k:long () %{ /* pure */ /* unprivileged */
#if defined(OMAP_L25) || defined(OMAP_L23)
cycles_t c = omap_readl(OMAP3430_32KSYNCT_BASE + 0x10);
#elif defined(OMAP_L24) || defined(OMAP_L27)
cycles_t c = omap_readl(OMAP4430_32KSYNCT_BASE + 0x10);
#else
cycles_t c = 0;
#endif
THIS->__retvalue = (uint64_t) c;
%}
function elapsed_t_mod32k(time2, time1) {
return ((time2-time1) % (1 << 32));
}
// this function is used to "perf" tool timestamping. get_32k() + this function help computing time offset between the tools
function sys_sched_clock:long () %{ /* pure */ /* unprivileged */
THIS->__retvalue = (uint64_t) sched_clock();
%}
// likewise jiffies, monotonic_clock ...