blob: 0e1605538cd47a61751e8da575e2b7e33d1f7ea0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Jan Glaubere4b8b3f2012-07-31 10:52:05 +02002#ifndef _RUNTIME_INSTR_H
3#define _RUNTIME_INSTR_H
4
Heiko Carstensdf2f8152018-01-22 10:26:20 +01005#include <uapi/asm/runtime_instr.h>
Jan Glaubere4b8b3f2012-07-31 10:52:05 +02006
7extern struct runtime_instr_cb runtime_instr_empty_cb;
8
Jan Glaubere4b8b3f2012-07-31 10:52:05 +02009static inline void save_ri_cb(struct runtime_instr_cb *cb_prev)
10{
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020011 if (cb_prev)
12 store_runtime_instr_cb(cb_prev);
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020013}
14
15static inline void restore_ri_cb(struct runtime_instr_cb *cb_next,
16 struct runtime_instr_cb *cb_prev)
17{
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020018 if (cb_next)
19 load_runtime_instr_cb(cb_next);
20 else if (cb_prev)
21 load_runtime_instr_cb(&runtime_instr_empty_cb);
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020022}
23
Heiko Carstens8d9047f2017-09-11 11:24:22 +020024struct task_struct;
25
26void runtime_instr_release(struct task_struct *tsk);
Jan Glaubere4b8b3f2012-07-31 10:52:05 +020027
28#endif /* _RUNTIME_INSTR_H */