changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/port/portclock.c

revision 6937: 62ba89f5ffb8
parent 5848: 381f1cb08002
child 6938: 2109eab7793b
     1.1--- a/sys/src/9/port/portclock.c
     1.2+++ b/sys/src/9/port/portclock.c
     1.3@@ -5,6 +5,7 @@
     1.4 #include "fns.h"
     1.5 #include "io.h"
     1.6 #include "ureg.h"
     1.7+#include "tos.h"
     1.8 
     1.9 struct Timers
    1.10 {
    1.11@@ -167,8 +168,16 @@ hzclock(Ureg *ur)
    1.12 	if(m->machno == 0)
    1.13 		checkalarms();
    1.14 
    1.15-	if(up && up->state == Running)
    1.16+	if(up && up->state == Running){
    1.17+		if(userureg(ur)){
    1.18+			/* user profiling clock */
    1.19+			Tos *tos = (Tos*)(USTKTOP-sizeof(Tos));
    1.20+			tos->clock += TK2MS(1);
    1.21+			segclock(ur->pc);
    1.22+		}
    1.23+
    1.24 		hzsched();	/* in proc.c */
    1.25+	}
    1.26 }
    1.27 
    1.28 void