aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 1201880cab40..1770a066c217 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -45,9 +45,9 @@
45#include <asm/mmu.h> 45#include <asm/mmu.h>
46#include <asm/prom.h> 46#include <asm/prom.h>
47#include <asm/machdep.h> 47#include <asm/machdep.h>
48#include <asm/time.h>
48#ifdef CONFIG_PPC64 49#ifdef CONFIG_PPC64
49#include <asm/firmware.h> 50#include <asm/firmware.h>
50#include <asm/time.h>
51#endif 51#endif
52 52
53extern unsigned long _get_SP(void); 53extern unsigned long _get_SP(void);
@@ -328,6 +328,11 @@ struct task_struct *__switch_to(struct task_struct *prev,
328#endif 328#endif
329 329
330 local_irq_save(flags); 330 local_irq_save(flags);
331
332 account_system_vtime(current);
333 account_process_vtime(current);
334 calculate_steal_time();
335
331 last = _switch(old_thread, new_thread); 336 last = _switch(old_thread, new_thread);
332 337
333 local_irq_restore(flags); 338 local_irq_restore(flags);
@@ -886,3 +891,35 @@ void dump_stack(void)
886 show_stack(current, NULL); 891 show_stack(current, NULL);
887} 892}
888EXPORT_SYMBOL(dump_stack); 893EXPORT_SYMBOL(dump_stack);
894
895#ifdef CONFIG_PPC64
896void ppc64_runlatch_on(void)
897{
898 unsigned long ctrl;
899
900 if (cpu_has_feature(CPU_FTR_CTRL) && !test_thread_flag(TIF_RUNLATCH)) {
901 HMT_medium();
902
903 ctrl = mfspr(SPRN_CTRLF);
904 ctrl |= CTRL_RUNLATCH;
905 mtspr(SPRN_CTRLT, ctrl);
906
907 set_thread_flag(TIF_RUNLATCH);
908 }
909}
910
911void ppc64_runlatch_off(void)
912{
913 unsigned long ctrl;
914
915 if (cpu_has_feature(CPU_FTR_CTRL) && test_thread_flag(TIF_RUNLATCH)) {
916 HMT_medium();
917
918 clear_thread_flag(TIF_RUNLATCH);
919
920 ctrl = mfspr(SPRN_CTRLF);
921 ctrl &= ~CTRL_RUNLATCH;
922 mtspr(SPRN_CTRLT, ctrl);
923 }
924}
925#endif