mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 14:05:46 +07:00
b672592f02
cputime_t is now only used by two architectures: * powerpc (when CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y) * s390 And since the core doesn't use it anymore, we don't need any arch support from the others. So we can remove their stub implementations. A final cleanup would be to provide an efficient pure arch implementation of cputime_to_nsec() for s390 and powerpc and finally remove include/linux/cputime.h . Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Wanpeng Li <wanpeng.li@hotmail.com> Link: http://lkml.kernel.org/r/1485832191-26889-36-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
58 lines
1.6 KiB
C
58 lines
1.6 KiB
C
/*
|
|
* Definitions for measuring cputime on powerpc machines.
|
|
*
|
|
* Copyright (C) 2006 Paul Mackerras, IBM Corp.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*
|
|
* If we have CONFIG_VIRT_CPU_ACCOUNTING_NATIVE, we measure cpu time in
|
|
* the same units as the timebase. Otherwise we measure cpu time
|
|
* in jiffies using the generic definitions.
|
|
*/
|
|
|
|
#ifndef __POWERPC_CPUTIME_H
|
|
#define __POWERPC_CPUTIME_H
|
|
|
|
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/time.h>
|
|
#include <asm/div64.h>
|
|
#include <asm/time.h>
|
|
#include <asm/param.h>
|
|
#include <asm/cpu_has_feature.h>
|
|
|
|
typedef u64 __nocast cputime_t;
|
|
typedef u64 __nocast cputime64_t;
|
|
|
|
#define cmpxchg_cputime(ptr, old, new) cmpxchg(ptr, old, new)
|
|
|
|
#ifdef __KERNEL__
|
|
/*
|
|
* Convert cputime <-> microseconds
|
|
*/
|
|
extern u64 __cputime_usec_factor;
|
|
|
|
static inline unsigned long cputime_to_usecs(const cputime_t ct)
|
|
{
|
|
return mulhdu((__force u64) ct, __cputime_usec_factor);
|
|
}
|
|
|
|
/*
|
|
* PPC64 uses PACA which is task independent for storing accounting data while
|
|
* PPC32 uses struct thread_info, therefore at task switch the accounting data
|
|
* has to be populated in the new task
|
|
*/
|
|
#ifdef CONFIG_PPC64
|
|
static inline void arch_vtime_task_switch(struct task_struct *tsk) { }
|
|
#else
|
|
void arch_vtime_task_switch(struct task_struct *tsk);
|
|
#endif
|
|
|
|
#endif /* __KERNEL__ */
|
|
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
|
|
#endif /* __POWERPC_CPUTIME_H */
|