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