| .. | .. |
|---|
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | #ifndef __UM_PROCESSOR_H |
|---|
| 3 | 3 | #define __UM_PROCESSOR_H |
|---|
| 4 | +#include <linux/time-internal.h> |
|---|
| 4 | 5 | |
|---|
| 5 | 6 | /* include faultinfo structure */ |
|---|
| 6 | 7 | #include <sysdep/faultinfo.h> |
|---|
| .. | .. |
|---|
| 21 | 22 | #include <asm/user.h> |
|---|
| 22 | 23 | |
|---|
| 23 | 24 | /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ |
|---|
| 24 | | -static inline void rep_nop(void) |
|---|
| 25 | +static __always_inline void rep_nop(void) |
|---|
| 25 | 26 | { |
|---|
| 26 | 27 | __asm__ __volatile__("rep;nop": : :"memory"); |
|---|
| 27 | 28 | } |
|---|
| 28 | 29 | |
|---|
| 29 | | -#define cpu_relax() rep_nop() |
|---|
| 30 | +static __always_inline void cpu_relax(void) |
|---|
| 31 | +{ |
|---|
| 32 | + if (time_travel_mode == TT_MODE_INFCPU || |
|---|
| 33 | + time_travel_mode == TT_MODE_EXTERNAL) |
|---|
| 34 | + time_travel_ndelay(1); |
|---|
| 35 | + else |
|---|
| 36 | + rep_nop(); |
|---|
| 37 | +} |
|---|
| 30 | 38 | |
|---|
| 31 | 39 | #define task_pt_regs(t) (&(t)->thread.regs) |
|---|
| 32 | 40 | |
|---|