]>
git.ipfire.org Git - thirdparty/qemu.git/blob - include/exec/cpu_ldst_useronly_template.h
2 * User-only accessor function support
4 * Generate inline load/store functions for one data size.
6 * Generate a store function as well as signed and unsigned loads.
8 * Not used directly but included from cpu_ldst.h.
10 * Copyright (c) 2015 Linaro Limited
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
26 #if !defined(CODE_ACCESS)
27 #include "trace-root.h"
30 #include "trace/mem.h"
35 #define DATA_TYPE uint64_t
40 #define DATA_TYPE uint32_t
45 #define DATA_TYPE uint16_t
46 #define DATA_STYPE int16_t
51 #define DATA_TYPE uint8_t
52 #define DATA_STYPE int8_t
55 #error unsupported data size
59 #define RES_TYPE uint64_t
61 #define RES_TYPE uint32_t
64 static inline RES_TYPE
65 glue(glue(cpu_ld
, USUFFIX
), MEMSUFFIX
)(CPUArchState
*env
, abi_ptr ptr
)
69 set_helper_retaddr(1);
70 ret
= glue(glue(ld
, USUFFIX
), _p
)(g2h(ptr
));
71 clear_helper_retaddr();
73 uint16_t meminfo
= trace_mem_build_info(SHIFT
, false, MO_TE
, false,
75 trace_guest_mem_before_exec(env_cpu(env
), ptr
, meminfo
);
76 ret
= glue(glue(ld
, USUFFIX
), _p
)(g2h(ptr
));
82 static inline RES_TYPE
83 glue(glue(glue(cpu_ld
, USUFFIX
), MEMSUFFIX
), _ra
)(CPUArchState
*env
,
88 set_helper_retaddr(retaddr
);
89 ret
= glue(glue(cpu_ld
, USUFFIX
), MEMSUFFIX
)(env
, ptr
);
90 clear_helper_retaddr();
97 glue(glue(cpu_lds
, SUFFIX
), MEMSUFFIX
)(CPUArchState
*env
, abi_ptr ptr
)
101 set_helper_retaddr(1);
102 ret
= glue(glue(lds
, SUFFIX
), _p
)(g2h(ptr
));
103 clear_helper_retaddr();
105 uint16_t meminfo
= trace_mem_build_info(SHIFT
, true, MO_TE
, false,
107 trace_guest_mem_before_exec(env_cpu(env
), ptr
, meminfo
);
108 ret
= glue(glue(lds
, SUFFIX
), _p
)(g2h(ptr
));
109 qemu_plugin_vcpu_mem_cb(env_cpu(env
), ptr
, meminfo
);
116 glue(glue(glue(cpu_lds
, SUFFIX
), MEMSUFFIX
), _ra
)(CPUArchState
*env
,
121 set_helper_retaddr(retaddr
);
122 ret
= glue(glue(cpu_lds
, SUFFIX
), MEMSUFFIX
)(env
, ptr
);
123 clear_helper_retaddr();
126 #endif /* CODE_ACCESS */
127 #endif /* DATA_SIZE <= 2 */
131 glue(glue(cpu_st
, SUFFIX
), MEMSUFFIX
)(CPUArchState
*env
, abi_ptr ptr
,
134 uint16_t meminfo
= trace_mem_build_info(SHIFT
, false, MO_TE
, true,
136 trace_guest_mem_before_exec(env_cpu(env
), ptr
, meminfo
);
137 glue(glue(st
, SUFFIX
), _p
)(g2h(ptr
), v
);
138 qemu_plugin_vcpu_mem_cb(env_cpu(env
), ptr
, meminfo
);
142 glue(glue(glue(cpu_st
, SUFFIX
), MEMSUFFIX
), _ra
)(CPUArchState
*env
,
147 set_helper_retaddr(retaddr
);
148 glue(glue(cpu_st
, SUFFIX
), MEMSUFFIX
)(env
, ptr
, v
);
149 clear_helper_retaddr();