Skip to content

Commit d2ba802

Browse files
committed
tcg: Move helper_*_mmu decls to tcg/tcg-ldst.h
These functions have been replaced by cpu_*_mmu as the most proper interface to use from target code. Hide these declarations from code that should not use them. Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 1a2eaf9 commit d2ba802

File tree

5 files changed

+77
-71
lines changed

5 files changed

+77
-71
lines changed

accel/tcg/cputlb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#ifdef CONFIG_PLUGIN
4040
#include "qemu/plugin-memory.h"
4141
#endif
42+
#include "tcg/tcg-ldst.h"
4243

4344
/* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
4445
/* #define DEBUG_TLB */

include/tcg/tcg-ldst.h

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Memory helpers that will be used by TCG generated code.
3+
*
4+
* Copyright (c) 2008 Fabrice Bellard
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef TCG_LDST_H
26+
#define TCG_LDST_H 1
27+
28+
#ifdef CONFIG_SOFTMMU
29+
30+
/* Value zero-extended to tcg register size. */
31+
tcg_target_ulong helper_ret_ldub_mmu(CPUArchState *env, target_ulong addr,
32+
MemOpIdx oi, uintptr_t retaddr);
33+
tcg_target_ulong helper_le_lduw_mmu(CPUArchState *env, target_ulong addr,
34+
MemOpIdx oi, uintptr_t retaddr);
35+
tcg_target_ulong helper_le_ldul_mmu(CPUArchState *env, target_ulong addr,
36+
MemOpIdx oi, uintptr_t retaddr);
37+
uint64_t helper_le_ldq_mmu(CPUArchState *env, target_ulong addr,
38+
MemOpIdx oi, uintptr_t retaddr);
39+
tcg_target_ulong helper_be_lduw_mmu(CPUArchState *env, target_ulong addr,
40+
MemOpIdx oi, uintptr_t retaddr);
41+
tcg_target_ulong helper_be_ldul_mmu(CPUArchState *env, target_ulong addr,
42+
MemOpIdx oi, uintptr_t retaddr);
43+
uint64_t helper_be_ldq_mmu(CPUArchState *env, target_ulong addr,
44+
MemOpIdx oi, uintptr_t retaddr);
45+
46+
/* Value sign-extended to tcg register size. */
47+
tcg_target_ulong helper_ret_ldsb_mmu(CPUArchState *env, target_ulong addr,
48+
MemOpIdx oi, uintptr_t retaddr);
49+
tcg_target_ulong helper_le_ldsw_mmu(CPUArchState *env, target_ulong addr,
50+
MemOpIdx oi, uintptr_t retaddr);
51+
tcg_target_ulong helper_le_ldsl_mmu(CPUArchState *env, target_ulong addr,
52+
MemOpIdx oi, uintptr_t retaddr);
53+
tcg_target_ulong helper_be_ldsw_mmu(CPUArchState *env, target_ulong addr,
54+
MemOpIdx oi, uintptr_t retaddr);
55+
tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env, target_ulong addr,
56+
MemOpIdx oi, uintptr_t retaddr);
57+
58+
void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
59+
MemOpIdx oi, uintptr_t retaddr);
60+
void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
61+
MemOpIdx oi, uintptr_t retaddr);
62+
void helper_le_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
63+
MemOpIdx oi, uintptr_t retaddr);
64+
void helper_le_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
65+
MemOpIdx oi, uintptr_t retaddr);
66+
void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
67+
MemOpIdx oi, uintptr_t retaddr);
68+
void helper_be_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
69+
MemOpIdx oi, uintptr_t retaddr);
70+
void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
71+
MemOpIdx oi, uintptr_t retaddr);
72+
73+
#endif /* CONFIG_SOFTMMU */
74+
#endif /* TCG_LDST_H */

include/tcg/tcg.h

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,77 +1240,6 @@ uint64_t dup_const(unsigned vece, uint64_t c);
12401240
: (target_long)dup_const(VECE, C))
12411241
#endif
12421242

1243-
/*
1244-
* Memory helpers that will be used by TCG generated code.
1245-
*/
1246-
#ifdef CONFIG_SOFTMMU
1247-
/* Value zero-extended to tcg register size. */
1248-
tcg_target_ulong helper_ret_ldub_mmu(CPUArchState *env, target_ulong addr,
1249-
MemOpIdx oi, uintptr_t retaddr);
1250-
tcg_target_ulong helper_le_lduw_mmu(CPUArchState *env, target_ulong addr,
1251-
MemOpIdx oi, uintptr_t retaddr);
1252-
tcg_target_ulong helper_le_ldul_mmu(CPUArchState *env, target_ulong addr,
1253-
MemOpIdx oi, uintptr_t retaddr);
1254-
uint64_t helper_le_ldq_mmu(CPUArchState *env, target_ulong addr,
1255-
MemOpIdx oi, uintptr_t retaddr);
1256-
tcg_target_ulong helper_be_lduw_mmu(CPUArchState *env, target_ulong addr,
1257-
MemOpIdx oi, uintptr_t retaddr);
1258-
tcg_target_ulong helper_be_ldul_mmu(CPUArchState *env, target_ulong addr,
1259-
MemOpIdx oi, uintptr_t retaddr);
1260-
uint64_t helper_be_ldq_mmu(CPUArchState *env, target_ulong addr,
1261-
MemOpIdx oi, uintptr_t retaddr);
1262-
1263-
/* Value sign-extended to tcg register size. */
1264-
tcg_target_ulong helper_ret_ldsb_mmu(CPUArchState *env, target_ulong addr,
1265-
MemOpIdx oi, uintptr_t retaddr);
1266-
tcg_target_ulong helper_le_ldsw_mmu(CPUArchState *env, target_ulong addr,
1267-
MemOpIdx oi, uintptr_t retaddr);
1268-
tcg_target_ulong helper_le_ldsl_mmu(CPUArchState *env, target_ulong addr,
1269-
MemOpIdx oi, uintptr_t retaddr);
1270-
tcg_target_ulong helper_be_ldsw_mmu(CPUArchState *env, target_ulong addr,
1271-
MemOpIdx oi, uintptr_t retaddr);
1272-
tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env, target_ulong addr,
1273-
MemOpIdx oi, uintptr_t retaddr);
1274-
1275-
void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
1276-
MemOpIdx oi, uintptr_t retaddr);
1277-
void helper_le_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
1278-
MemOpIdx oi, uintptr_t retaddr);
1279-
void helper_le_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
1280-
MemOpIdx oi, uintptr_t retaddr);
1281-
void helper_le_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
1282-
MemOpIdx oi, uintptr_t retaddr);
1283-
void helper_be_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
1284-
MemOpIdx oi, uintptr_t retaddr);
1285-
void helper_be_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
1286-
MemOpIdx oi, uintptr_t retaddr);
1287-
void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
1288-
MemOpIdx oi, uintptr_t retaddr);
1289-
1290-
/* Temporary aliases until backends are converted. */
1291-
#ifdef TARGET_WORDS_BIGENDIAN
1292-
# define helper_ret_ldsw_mmu helper_be_ldsw_mmu
1293-
# define helper_ret_lduw_mmu helper_be_lduw_mmu
1294-
# define helper_ret_ldsl_mmu helper_be_ldsl_mmu
1295-
# define helper_ret_ldul_mmu helper_be_ldul_mmu
1296-
# define helper_ret_ldl_mmu helper_be_ldul_mmu
1297-
# define helper_ret_ldq_mmu helper_be_ldq_mmu
1298-
# define helper_ret_stw_mmu helper_be_stw_mmu
1299-
# define helper_ret_stl_mmu helper_be_stl_mmu
1300-
# define helper_ret_stq_mmu helper_be_stq_mmu
1301-
#else
1302-
# define helper_ret_ldsw_mmu helper_le_ldsw_mmu
1303-
# define helper_ret_lduw_mmu helper_le_lduw_mmu
1304-
# define helper_ret_ldsl_mmu helper_le_ldsl_mmu
1305-
# define helper_ret_ldul_mmu helper_le_ldul_mmu
1306-
# define helper_ret_ldl_mmu helper_le_ldul_mmu
1307-
# define helper_ret_ldq_mmu helper_le_ldq_mmu
1308-
# define helper_ret_stw_mmu helper_le_stw_mmu
1309-
# define helper_ret_stl_mmu helper_le_stl_mmu
1310-
# define helper_ret_stq_mmu helper_le_stq_mmu
1311-
#endif
1312-
#endif /* CONFIG_SOFTMMU */
1313-
13141243
#ifdef CONFIG_DEBUG_TCG
13151244
void tcg_assert_listed_vecop(TCGOpcode);
13161245
#else

tcg/tcg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
#include "elf.h"
6060
#include "exec/log.h"
61+
#include "tcg/tcg-ldst.h"
6162
#include "tcg-internal.h"
6263

6364
#ifdef CONFIG_TCG_INTERPRETER

tcg/tci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "tcg/tcg.h" /* MAX_OPC_PARAM_IARGS */
2323
#include "exec/cpu_ldst.h"
2424
#include "tcg/tcg-op.h"
25+
#include "tcg/tcg-ldst.h"
2526
#include "qemu/compiler.h"
2627
#include <ffi.h>
2728

0 commit comments

Comments
 (0)