mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
powerpc/64: entry cpu time accounting in C
There is no need for this to be in asm, use the new interrupt entry wrapper. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210130130852.2952424-39-npiggin@gmail.com
This commit is contained in:
parent
2994e1babf
commit
56acfdd8bf
4 changed files with 6 additions and 30 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <linux/context_tracking.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <asm/cputime.h>
|
||||
#include <asm/ftrace.h>
|
||||
|
||||
struct interrupt_state {
|
||||
|
@ -25,6 +26,9 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
|
|||
if (user_mode(regs)) {
|
||||
CT_WARN_ON(ct_state() != CONTEXT_USER);
|
||||
user_exit_irqoff();
|
||||
|
||||
account_cpu_user_entry();
|
||||
account_stolen_time();
|
||||
} else {
|
||||
/*
|
||||
* CT_WARN_ON comes here via program_check_exception,
|
||||
|
@ -37,6 +41,8 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
|
|||
|
||||
#ifdef CONFIG_PPC_BOOK3E_64
|
||||
state->ctx_state = exception_enter();
|
||||
if (user_mode(regs))
|
||||
account_cpu_user_entry();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue