hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/mips/include/asm/dsemul.h
....@@ -1,11 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2016 Imagination Technologies
34 * Author: Paul Burton <paul.burton@mips.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License as published by the
7
- * Free Software Foundation; either version 2 of the License, or (at your
8
- * option) any later version.
95 */
106
117 #ifndef __MIPS_ASM_DSEMUL_H__
....@@ -52,7 +48,14 @@
5248 *
5349 * Return: True if an emulation frame was returned from, else false.
5450 */
51
+#ifdef CONFIG_MIPS_FP_SUPPORT
5552 extern bool do_dsemulret(struct pt_regs *xcp);
53
+#else
54
+static inline bool do_dsemulret(struct pt_regs *xcp)
55
+{
56
+ return false;
57
+}
58
+#endif
5659
5760 /**
5861 * dsemul_thread_cleanup() - Cleanup thread 'emulation' frame
....@@ -63,8 +66,14 @@
6366 *
6467 * Return: True if a frame was freed, else false.
6568 */
69
+#ifdef CONFIG_MIPS_FP_SUPPORT
6670 extern bool dsemul_thread_cleanup(struct task_struct *tsk);
67
-
71
+#else
72
+static inline bool dsemul_thread_cleanup(struct task_struct *tsk)
73
+{
74
+ return false;
75
+}
76
+#endif
6877 /**
6978 * dsemul_thread_rollback() - Rollback from an 'emulation' frame
7079 * @regs: User thread register context.
....@@ -77,7 +86,14 @@
7786 *
7887 * Return: True if a frame was exited, else false.
7988 */
89
+#ifdef CONFIG_MIPS_FP_SUPPORT
8090 extern bool dsemul_thread_rollback(struct pt_regs *regs);
91
+#else
92
+static inline bool dsemul_thread_rollback(struct pt_regs *regs)
93
+{
94
+ return false;
95
+}
96
+#endif
8197
8298 /**
8399 * dsemul_mm_cleanup() - Cleanup per-mm delay slot 'emulation' state
....@@ -87,6 +103,13 @@
87103 * for delay slot 'emulation' book-keeping is freed. This is to be called
88104 * before @mm is freed in order to avoid memory leaks.
89105 */
106
+#ifdef CONFIG_MIPS_FP_SUPPORT
90107 extern void dsemul_mm_cleanup(struct mm_struct *mm);
108
+#else
109
+static inline void dsemul_mm_cleanup(struct mm_struct *mm)
110
+{
111
+ /* no-op */
112
+}
113
+#endif
91114
92115 #endif /* __MIPS_ASM_DSEMUL_H__ */