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