SCCS-vsn: sys/vax/vax/locore.s 4.74
SCCS-vsn: sys/vax/vax/trap.c 4.25
SCCS-vsn: sys/kern/kern_clock.c 4.46
-/* kern_clock.c 4.45 82/11/13 */
+/* kern_clock.c 4.46 82/12/09 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/psl.h"
#include "../h/vm.h"
#include "../h/text.h"
#include "../h/psl.h"
#include "../h/vm.h"
#include "../h/text.h"
+#ifdef vax
+#include "../vax/mtpr.h"
+#endif
#ifdef MUSH
#include "../h/quota.h"
#include "../h/share.h"
#ifdef MUSH
#include "../h/quota.h"
#include "../h/share.h"
/*
* CPU was in user state. Increment
* user time counter, and process process-virtual time
/*
* CPU was in user state. Increment
* user time counter, and process process-virtual time
*/
bumptime(&u.u_ru.ru_utime, tick);
if (timerisset(&u.u_timer[ITIMER_VIRTUAL].it_value) &&
*/
bumptime(&u.u_ru.ru_utime, tick);
if (timerisset(&u.u_timer[ITIMER_VIRTUAL].it_value) &&
splx(s);
(*func)(arg, a);
}
splx(s);
(*func)(arg, a);
}
+ /*
+ * If trapped user-mode, give it a profiling tick.
+ */
+ if (USERMODE(ps) && u.u_prof.pr_scale) {
+ u.u_procp->p_flag |= SOWEUPC;
+ aston();
+ }
-/* locore.s 4.73 82/11/03 */
+/* locore.s 4.74 82/12/09 */
#include "../vax/mtpr.h"
#include "../vax/trap.h"
#include "../vax/mtpr.h"
#include "../vax/trap.h"
+_addupc: .globl _addupc
+ .word 0x0
+ movl 8(ap),r2 # &u.u_prof
+ subl3 8(r2),4(ap),r0 # corrected pc
+ blss 9f
+ extzv $1,$31,r0,r0 # logical right shift
+ extzv $1,$31,12(r2),r1 # ditto for scale
+ emul r1,r0,$0,r0
+ ashq $-14,r0,r0
+ tstl r1
+ bneq 9f
+ incl r0
+ bicl2 $1,r0
+ cmpl r0,4(r2) # length
+ bgequ 9f
+ addl2 (r2),r0 # base
+ probew $3,$2,(r0)
+ beql 8f
+ addw2 12(ap),(r0)
+9:
+ ret
+8:
+ clrl 12(r2)
+ ret
+
_Copyin: .globl _Copyin # <<<massaged for jsb by asm.sed>>>
movl 12(sp),r0 # copy length
blss ersb
_Copyin: .globl _Copyin # <<<massaged for jsb by asm.sed>>>
movl 12(sp),r0 # copy length
blss ersb
-/* trap.c 4.24 82/11/13 */
+/* trap.c 4.25 82/12/09 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/psl.h"
#include "../h/pte.h"
#include "../h/acct.h"
#include "../h/psl.h"
#include "../h/pte.h"
#include "../h/acct.h"
+#include "../h/kernel.h"
#ifdef SYSCALLTRACE
#include "../sys/syscalls.c"
#endif
#ifdef SYSCALLTRACE
#include "../sys/syscalls.c"
#endif
register int *locr0 = ((int *)&psl)-PS;
register int i;
register struct proc *p;
register int *locr0 = ((int *)&psl)-PS;
register int i;
register struct proc *p;
+ syst = u.u_ru.ru_stime;
if (USERMODE(locr0[PS])) {
type |= USER;
u.u_ar0 = locr0;
if (USERMODE(locr0[PS])) {
type |= USER;
u.u_ar0 = locr0;
case T_ASTFLT+USER:
astoff();
case T_ASTFLT+USER:
astoff();
+ if ((u.u_procp->p_flag & SOWEUPC) && u.u_prof.pr_scale) {
+ addupc(pc, &u.u_prof, 1);
+ u.u_procp->p_flag &= ~SOWEUPC;
+ }
goto out;
case T_ARITHTRAP+USER:
goto out;
case T_ARITHTRAP+USER:
u.u_ru.ru_nivcsw++;
swtch();
}
u.u_ru.ru_nivcsw++;
swtch();
}
+ if (u.u_prof.pr_scale) {
+ int ticks;
+ struct timeval *tv = &u.u_ru.ru_stime;
+
+ ticks = ((tv->tv_sec - syst.tv_sec) * 1000 +
+ (tv->tv_usec - syst.tv_usec) / 1000) / (tick / 1000);
+ if (ticks)
+ addupc(locr0[PC], &u.u_prof, ticks);
+ }
register struct sysent *callp;
register struct proc *p;
int opc;
register struct sysent *callp;
register struct proc *p;
int opc;
+ syst = u.u_ru.ru_stime;
if (!USERMODE(locr0[PS]))
panic("syscall");
u.u_ar0 = locr0;
if (!USERMODE(locr0[PS]))
panic("syscall");
u.u_ar0 = locr0;
u.u_ru.ru_nivcsw++;
swtch();
}
u.u_ru.ru_nivcsw++;
swtch();
}
+ if (u.u_prof.pr_scale) {
+ int ticks;
+ struct timeval *tv = &u.u_ru.ru_stime;
+
+ ticks = ((tv->tv_sec - syst.tv_sec) * 1000 +
+ (tv->tv_usec - syst.tv_usec) / 1000) / (tick / 1000);
+ if (ticks)
+ addupc(locr0[PC], &u.u_prof, ticks);
+ }