diff options
author | Tony Luck <tony.luck@intel.com> | 2008-04-17 13:12:27 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-04-17 13:12:27 -0400 |
commit | 14d0647c98f52e2d76113d44de6b771ec87a934f (patch) | |
tree | 4b9407b00ad0b5baf5ee6245a4157a07062680b5 /arch/ia64/kernel/fsys.S | |
parent | 2a467d5f7d6bdc90c365db167a10022dd8351894 (diff) | |
parent | b64f34cdfe5bef9dfed1304c513220b0f2862eca (diff) |
Pull virt-cpu-accounting into release branch
Diffstat (limited to 'arch/ia64/kernel/fsys.S')
-rw-r--r-- | arch/ia64/kernel/fsys.S | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index 6a72db7ddecc..357b7e2adc63 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S | |||
@@ -656,7 +656,11 @@ GLOBAL_ENTRY(fsys_bubble_down) | |||
656 | nop.i 0 | 656 | nop.i 0 |
657 | ;; | 657 | ;; |
658 | mov ar.rsc=0 // M2 set enforced lazy mode, pl 0, LE, loadrs=0 | 658 | mov ar.rsc=0 // M2 set enforced lazy mode, pl 0, LE, loadrs=0 |
659 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
660 | mov.m r30=ar.itc // M get cycle for accounting | ||
661 | #else | ||
659 | nop.m 0 | 662 | nop.m 0 |
663 | #endif | ||
660 | nop.i 0 | 664 | nop.i 0 |
661 | ;; | 665 | ;; |
662 | mov r23=ar.bspstore // M2 (12 cyc) save ar.bspstore | 666 | mov r23=ar.bspstore // M2 (12 cyc) save ar.bspstore |
@@ -678,6 +682,28 @@ GLOBAL_ENTRY(fsys_bubble_down) | |||
678 | cmp.ne pKStk,pUStk=r0,r0 // A set pKStk <- 0, pUStk <- 1 | 682 | cmp.ne pKStk,pUStk=r0,r0 // A set pKStk <- 0, pUStk <- 1 |
679 | br.call.sptk.many b7=ia64_syscall_setup // B | 683 | br.call.sptk.many b7=ia64_syscall_setup // B |
680 | ;; | 684 | ;; |
685 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
686 | // mov.m r30=ar.itc is called in advance | ||
687 | add r16=TI_AC_STAMP+IA64_TASK_SIZE,r2 | ||
688 | add r17=TI_AC_LEAVE+IA64_TASK_SIZE,r2 | ||
689 | ;; | ||
690 | ld8 r18=[r16],TI_AC_STIME-TI_AC_STAMP // time at last check in kernel | ||
691 | ld8 r19=[r17],TI_AC_UTIME-TI_AC_LEAVE // time at leave kernel | ||
692 | ;; | ||
693 | ld8 r20=[r16],TI_AC_STAMP-TI_AC_STIME // cumulated stime | ||
694 | ld8 r21=[r17] // cumulated utime | ||
695 | sub r22=r19,r18 // stime before leave kernel | ||
696 | ;; | ||
697 | st8 [r16]=r30,TI_AC_STIME-TI_AC_STAMP // update stamp | ||
698 | sub r18=r30,r19 // elapsed time in user mode | ||
699 | ;; | ||
700 | add r20=r20,r22 // sum stime | ||
701 | add r21=r21,r18 // sum utime | ||
702 | ;; | ||
703 | st8 [r16]=r20 // update stime | ||
704 | st8 [r17]=r21 // update utime | ||
705 | ;; | ||
706 | #endif | ||
681 | mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0 | 707 | mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0 |
682 | mov rp=r14 // I0 set the real return addr | 708 | mov rp=r14 // I0 set the real return addr |
683 | and r3=_TIF_SYSCALL_TRACEAUDIT,r3 // A | 709 | and r3=_TIF_SYSCALL_TRACEAUDIT,r3 // A |