diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-25 20:17:39 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-10-25 20:17:39 +0200 |
commit | 3fce94e7850ab80d14fa15f2f393ae71259376e5 (patch) | |
tree | c9eb3d2b3b52130690c1fcce43afabd4e9adfcdd /sys/src/9/omap | |
parent | 83865180a29d7feba2a1f460abf17315562141c3 (diff) |
fix _tos->pcycles, make _tos->kcycles actually count cycles executing kernel code on behalf of the process
Diffstat (limited to 'sys/src/9/omap')
-rw-r--r-- | sys/src/9/omap/arch.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/src/9/omap/arch.c b/sys/src/9/omap/arch.c index 53fb71e85..4714168b0 100644 --- a/sys/src/9/omap/arch.c +++ b/sys/src/9/omap/arch.c @@ -50,7 +50,7 @@ kexit(Ureg*) tos = (Tos*)(USTKTOP-sizeof(Tos)); cycles(&t); tos->kcycles += t - up->kentry; - tos->pcycles = up->pcycles; + tos->pcycles = t + up->pcycles; tos->cyclefreq = m->cpuhz; tos->pid = up->pid; @@ -124,11 +124,16 @@ void procsetup(Proc* p) { fpusysprocsetup(p); + + cycles(&p->kentry); + p->pcycles = -p->kentry; } void -procfork(Proc*) +procfork(Proc* p) { + p->kentry = up->kentry; + p->pcycles = -p->kentry; } /* @@ -141,6 +146,7 @@ procsave(Proc* p) cycles(&t); p->pcycles += t; + p->kentry -= t; // TODO: save and restore VFPv3 FP state once 5[cal] know the new registers. fpuprocsave(p); @@ -155,6 +161,7 @@ procrestore(Proc* p) return; cycles(&t); p->pcycles -= t; + p->kentry += t; fpuprocrestore(p); } |