osproject_syscall.c 428 Bytes
#include <stdio.h>
int main()
{
unsigned int regr;
unsigned int i;
unsigned int a, b;
asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r" (regr));
printf("regr: %x\n", regr);
regr = 0;
while ( regr < 10)
{
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (a));
i = getpid();
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (b));
printf("PID: %u, Time for getpid: %u\n", i, b - a);
regr++;
}
return 1;
}