xref: /qemu/include/accel/tcg/cpu-ops.h (revision 981f2beb161b9bcaeedc1f91ad22bff255856cb2)
178271684SClaudio Fontana /*
278271684SClaudio Fontana  * TCG CPU-specific operations
378271684SClaudio Fontana  *
478271684SClaudio Fontana  * Copyright 2021 SUSE LLC
578271684SClaudio Fontana  *
678271684SClaudio Fontana  * This work is licensed under the terms of the GNU GPL, version 2 or later.
778271684SClaudio Fontana  * See the COPYING file in the top-level directory.
878271684SClaudio Fontana  */
978271684SClaudio Fontana 
1078271684SClaudio Fontana #ifndef TCG_CPU_OPS_H
1178271684SClaudio Fontana #define TCG_CPU_OPS_H
1278271684SClaudio Fontana 
1376d07d32SPhilippe Mathieu-Daudé #include "exec/breakpoint.h"
1476d07d32SPhilippe Mathieu-Daudé #include "exec/hwaddr.h"
1576d07d32SPhilippe Mathieu-Daudé #include "exec/memattrs.h"
16f168808dSRichard Henderson #include "exec/memop.h"
1776d07d32SPhilippe Mathieu-Daudé #include "exec/mmu-access-type.h"
1876d07d32SPhilippe Mathieu-Daudé #include "exec/vaddr.h"
194759aae4SRichard Henderson #include "accel/tcg/tb-cpu-state.h"
2004583ce7SPhilippe Mathieu-Daudé #include "tcg/tcg-mo.h"
2178271684SClaudio Fontana 
2278271684SClaudio Fontana struct TCGCPUOps {
23a3d40b5eSPhilippe Mathieu-Daudé     /**
24a3d40b5eSPhilippe Mathieu-Daudé      * mttcg_supported: multi-threaded TCG is supported
25a3d40b5eSPhilippe Mathieu-Daudé      *
26a3d40b5eSPhilippe Mathieu-Daudé      * Target (TCG frontend) supports:
27a3d40b5eSPhilippe Mathieu-Daudé      *   - atomic instructions
28a3d40b5eSPhilippe Mathieu-Daudé      *   - memory ordering primitives (barriers)
29a3d40b5eSPhilippe Mathieu-Daudé      */
30a3d40b5eSPhilippe Mathieu-Daudé     bool mttcg_supported;
3104583ce7SPhilippe Mathieu-Daudé 
3204583ce7SPhilippe Mathieu-Daudé     /**
3377ad412bSRichard Henderson      * @precise_smc: Stores which modify code within the current TB force
3477ad412bSRichard Henderson      *               the TB to exit; the next executed instruction will see
3577ad412bSRichard Henderson      *               the result of the store.
3677ad412bSRichard Henderson      */
3777ad412bSRichard Henderson     bool precise_smc;
3877ad412bSRichard Henderson 
3977ad412bSRichard Henderson     /**
4004583ce7SPhilippe Mathieu-Daudé      * @guest_default_memory_order: default barrier that is required
4104583ce7SPhilippe Mathieu-Daudé      *                              for the guest memory ordering.
4204583ce7SPhilippe Mathieu-Daudé      */
4304583ce7SPhilippe Mathieu-Daudé     TCGBar guest_default_memory_order;
4404583ce7SPhilippe Mathieu-Daudé 
4578271684SClaudio Fontana     /**
46669dcb60SMichael Tokarev      * @initialize: Initialize TCG state
4778271684SClaudio Fontana      *
4878271684SClaudio Fontana      * Called when the first CPU is realized.
4978271684SClaudio Fontana      */
5078271684SClaudio Fontana     void (*initialize)(void);
5178271684SClaudio Fontana     /**
52e4a8e093SRichard Henderson      * @translate_code: Translate guest instructions to TCGOps
53e4a8e093SRichard Henderson      * @cpu: cpu context
54e4a8e093SRichard Henderson      * @tb: translation block
55e4a8e093SRichard Henderson      * @max_insns: max number of instructions to translate
56e4a8e093SRichard Henderson      * @pc: guest virtual program counter address
57e4a8e093SRichard Henderson      * @host_pc: host physical program counter address
58e4a8e093SRichard Henderson      *
59e4a8e093SRichard Henderson      * This function must be provided by the target, which should create
60e4a8e093SRichard Henderson      * the target-specific DisasContext, and then invoke translator_loop.
61e4a8e093SRichard Henderson      */
62e4a8e093SRichard Henderson     void (*translate_code)(CPUState *cpu, TranslationBlock *tb,
63e4a8e093SRichard Henderson                            int *max_insns, vaddr pc, void *host_pc);
64e4a8e093SRichard Henderson     /**
65c37f8978SRichard Henderson      * @get_tb_cpu_state: Extract CPU state for a TCG #TranslationBlock
66c37f8978SRichard Henderson      *
67c37f8978SRichard Henderson      * Fill in all data required to select or compile a TranslationBlock.
68c37f8978SRichard Henderson      */
69c37f8978SRichard Henderson     TCGTBCPUState (*get_tb_cpu_state)(CPUState *cs);
70c37f8978SRichard Henderson     /**
7178271684SClaudio Fontana      * @synchronize_from_tb: Synchronize state from a TCG #TranslationBlock
7278271684SClaudio Fontana      *
7378271684SClaudio Fontana      * This is called when we abandon execution of a TB before starting it,
7478271684SClaudio Fontana      * and must set all parts of the CPU state which the previous TB in the
7578271684SClaudio Fontana      * chain may not have updated.
7678271684SClaudio Fontana      * By default, when this is NULL, a call is made to @set_pc(tb->pc).
7778271684SClaudio Fontana      *
7878271684SClaudio Fontana      * If more state needs to be restored, the target must implement a
7978271684SClaudio Fontana      * function to restore all the state, and register it here.
8078271684SClaudio Fontana      */
818349d2aeSRichard Henderson     void (*synchronize_from_tb)(CPUState *cpu, const TranslationBlock *tb);
82d2925689SRichard Henderson     /**
83d2925689SRichard Henderson      * @restore_state_to_opc: Synchronize state from INDEX_op_start_insn
84d2925689SRichard Henderson      *
85d2925689SRichard Henderson      * This is called when we unwind state in the middle of a TB,
86d2925689SRichard Henderson      * usually before raising an exception.  Set all part of the CPU
87d2925689SRichard Henderson      * state which are tracked insn-by-insn in the target-specific
88d2925689SRichard Henderson      * arguments to start_insn, passed as @data.
89d2925689SRichard Henderson      */
90d2925689SRichard Henderson     void (*restore_state_to_opc)(CPUState *cpu, const TranslationBlock *tb,
91d2925689SRichard Henderson                                  const uint64_t *data);
92d2925689SRichard Henderson 
9378271684SClaudio Fontana     /** @cpu_exec_enter: Callback for cpu_exec preparation */
9478271684SClaudio Fontana     void (*cpu_exec_enter)(CPUState *cpu);
9578271684SClaudio Fontana     /** @cpu_exec_exit: Callback for cpu_exec cleanup */
9678271684SClaudio Fontana     void (*cpu_exec_exit)(CPUState *cpu);
9778271684SClaudio Fontana     /** @debug_excp_handler: Callback for handling debug exceptions */
9878271684SClaudio Fontana     void (*debug_excp_handler)(CPUState *cpu);
9978271684SClaudio Fontana 
10017fa8b6fSPhilippe Mathieu-Daudé     /** @mmu_index: Callback for choosing softmmu mmu index */
10117fa8b6fSPhilippe Mathieu-Daudé     int (*mmu_index)(CPUState *cpu, bool ifetch);
10217fa8b6fSPhilippe Mathieu-Daudé 
103fd3f7d24SAnton Johansson #ifdef CONFIG_USER_ONLY
10412096421SPhilippe Mathieu-Daudé     /**
10512096421SPhilippe Mathieu-Daudé      * @fake_user_interrupt: Callback for 'fake exception' handling.
10612096421SPhilippe Mathieu-Daudé      *
10712096421SPhilippe Mathieu-Daudé      * Simulate 'fake exception' which will be handled outside the
10812096421SPhilippe Mathieu-Daudé      * cpu execution loop (hack for x86 user mode).
10912096421SPhilippe Mathieu-Daudé      */
11012096421SPhilippe Mathieu-Daudé     void (*fake_user_interrupt)(CPUState *cpu);
111fd3f7d24SAnton Johansson 
11275fe97b4SPhilippe Mathieu-Daudé     /**
11375fe97b4SPhilippe Mathieu-Daudé      * record_sigsegv:
11475fe97b4SPhilippe Mathieu-Daudé      * @cpu: cpu context
11575fe97b4SPhilippe Mathieu-Daudé      * @addr: faulting guest address
11675fe97b4SPhilippe Mathieu-Daudé      * @access_type: access was read/write/execute
11775fe97b4SPhilippe Mathieu-Daudé      * @maperr: true for invalid page, false for permission fault
11875fe97b4SPhilippe Mathieu-Daudé      * @ra: host pc for unwinding
11975fe97b4SPhilippe Mathieu-Daudé      *
12075fe97b4SPhilippe Mathieu-Daudé      * We are about to raise SIGSEGV with si_code set for @maperr,
12175fe97b4SPhilippe Mathieu-Daudé      * and si_addr set for @addr.  Record anything further needed
12275fe97b4SPhilippe Mathieu-Daudé      * for the signal ucontext_t.
12375fe97b4SPhilippe Mathieu-Daudé      *
12475fe97b4SPhilippe Mathieu-Daudé      * If the emulated kernel does not provide anything to the signal
12575fe97b4SPhilippe Mathieu-Daudé      * handler with anything besides the user context registers, and
12675fe97b4SPhilippe Mathieu-Daudé      * the siginfo_t, then this hook need do nothing and may be omitted.
12775fe97b4SPhilippe Mathieu-Daudé      * Otherwise, record the data and return; the caller will raise
12875fe97b4SPhilippe Mathieu-Daudé      * the signal, unwind the cpu state, and return to the main loop.
12975fe97b4SPhilippe Mathieu-Daudé      *
13075fe97b4SPhilippe Mathieu-Daudé      * If it is simpler to re-use the sysemu tlb_fill code, @ra is provided
13175fe97b4SPhilippe Mathieu-Daudé      * so that a "normal" cpu exception can be raised.  In this case,
13275fe97b4SPhilippe Mathieu-Daudé      * the signal must be raised by the architecture cpu_loop.
13375fe97b4SPhilippe Mathieu-Daudé      */
13475fe97b4SPhilippe Mathieu-Daudé     void (*record_sigsegv)(CPUState *cpu, vaddr addr,
13575fe97b4SPhilippe Mathieu-Daudé                            MMUAccessType access_type,
13675fe97b4SPhilippe Mathieu-Daudé                            bool maperr, uintptr_t ra);
13775fe97b4SPhilippe Mathieu-Daudé     /**
13875fe97b4SPhilippe Mathieu-Daudé      * record_sigbus:
13975fe97b4SPhilippe Mathieu-Daudé      * @cpu: cpu context
14075fe97b4SPhilippe Mathieu-Daudé      * @addr: misaligned guest address
14175fe97b4SPhilippe Mathieu-Daudé      * @access_type: access was read/write/execute
14275fe97b4SPhilippe Mathieu-Daudé      * @ra: host pc for unwinding
14375fe97b4SPhilippe Mathieu-Daudé      *
14475fe97b4SPhilippe Mathieu-Daudé      * We are about to raise SIGBUS with si_code BUS_ADRALN,
14575fe97b4SPhilippe Mathieu-Daudé      * and si_addr set for @addr.  Record anything further needed
14675fe97b4SPhilippe Mathieu-Daudé      * for the signal ucontext_t.
14775fe97b4SPhilippe Mathieu-Daudé      *
14875fe97b4SPhilippe Mathieu-Daudé      * If the emulated kernel does not provide the signal handler with
14975fe97b4SPhilippe Mathieu-Daudé      * anything besides the user context registers, and the siginfo_t,
15075fe97b4SPhilippe Mathieu-Daudé      * then this hook need do nothing and may be omitted.
15175fe97b4SPhilippe Mathieu-Daudé      * Otherwise, record the data and return; the caller will raise
15275fe97b4SPhilippe Mathieu-Daudé      * the signal, unwind the cpu state, and return to the main loop.
15375fe97b4SPhilippe Mathieu-Daudé      *
15475fe97b4SPhilippe Mathieu-Daudé      * If it is simpler to re-use the sysemu do_unaligned_access code,
15575fe97b4SPhilippe Mathieu-Daudé      * @ra is provided so that a "normal" cpu exception can be raised.
15675fe97b4SPhilippe Mathieu-Daudé      * In this case, the signal must be raised by the architecture cpu_loop.
15775fe97b4SPhilippe Mathieu-Daudé      */
15875fe97b4SPhilippe Mathieu-Daudé     void (*record_sigbus)(CPUState *cpu, vaddr addr,
15975fe97b4SPhilippe Mathieu-Daudé                           MMUAccessType access_type, uintptr_t ra);
1602c0b261fSRichard Henderson 
1612c0b261fSRichard Henderson     /**
1622c0b261fSRichard Henderson      * untagged_addr: Remove an ignored tag from an address
1632c0b261fSRichard Henderson      * @cpu: cpu context
1642c0b261fSRichard Henderson      * @addr: tagged guest address
1652c0b261fSRichard Henderson      */
1662c0b261fSRichard Henderson     vaddr (*untagged_addr)(CPUState *cs, vaddr addr);
16775fe97b4SPhilippe Mathieu-Daudé #else
168b11cdf27SAnton Johansson     /** @do_interrupt: Callback for interrupt handling.  */
169b11cdf27SAnton Johansson     void (*do_interrupt)(CPUState *cpu);
17077c0fc4eSPhilippe Mathieu-Daudé     /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */
17177c0fc4eSPhilippe Mathieu-Daudé     bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request);
1729181ab45SRichard Henderson     /** @cpu_exec_reset: Callback for reset in cpu_exec.  */
1739181ab45SRichard Henderson     void (*cpu_exec_reset)(CPUState *cpu);
174408b2b3dSPeter Maydell     /**
175408b2b3dSPeter Maydell      * @cpu_exec_halt: Callback for handling halt in cpu_exec.
176408b2b3dSPeter Maydell      *
177408b2b3dSPeter Maydell      * The target CPU should do any special processing here that it needs
178408b2b3dSPeter Maydell      * to do when the CPU is in the halted state.
179408b2b3dSPeter Maydell      *
180408b2b3dSPeter Maydell      * Return true to indicate that the CPU should now leave halt, false
1810487c631SPeter Maydell      * if it should remain in the halted state. (This should generally
1820487c631SPeter Maydell      * be the same value that cpu_has_work() would return.)
183408b2b3dSPeter Maydell      *
1840487c631SPeter Maydell      * This method must be provided. If the target does not need to
1850487c631SPeter Maydell      * do anything special for halt, the same function used for its
18672eacd62SPhilippe Mathieu-Daudé      * SysemuCPUOps::has_work method can be used here, as they have the
1870487c631SPeter Maydell      * same function signature.
188408b2b3dSPeter Maydell      */
189408b2b3dSPeter Maydell     bool (*cpu_exec_halt)(CPUState *cpu);
19078271684SClaudio Fontana     /**
191f168808dSRichard Henderson      * @tlb_fill_align: Handle a softmmu tlb miss
192f168808dSRichard Henderson      * @cpu: cpu context
193f168808dSRichard Henderson      * @out: output page properties
194f168808dSRichard Henderson      * @addr: virtual address
195f168808dSRichard Henderson      * @access_type: read, write or execute
196f168808dSRichard Henderson      * @mmu_idx: mmu context
197f168808dSRichard Henderson      * @memop: memory operation for the access
198f168808dSRichard Henderson      * @size: memory access size, or 0 for whole page
199f168808dSRichard Henderson      * @probe: test only, no fault
200f168808dSRichard Henderson      * @ra: host return address for exception unwind
201f168808dSRichard Henderson      *
202f168808dSRichard Henderson      * If the access is valid, fill in @out and return true.
203f168808dSRichard Henderson      * Otherwise if probe is true, return false.
204f168808dSRichard Henderson      * Otherwise raise an exception and do not return.
205f168808dSRichard Henderson      *
206f168808dSRichard Henderson      * The alignment check for the access is deferred to this hook,
207f168808dSRichard Henderson      * so that the target can determine the priority of any alignment
208f168808dSRichard Henderson      * fault with respect to other potential faults from paging.
209f168808dSRichard Henderson      * Zero may be passed for @memop to skip any alignment check
210f168808dSRichard Henderson      * for non-memory-access operations such as probing.
211f168808dSRichard Henderson      */
212f168808dSRichard Henderson     bool (*tlb_fill_align)(CPUState *cpu, CPUTLBEntryFull *out, vaddr addr,
213f168808dSRichard Henderson                            MMUAccessType access_type, int mmu_idx,
214f168808dSRichard Henderson                            MemOp memop, int size, bool probe, uintptr_t ra);
215f168808dSRichard Henderson     /**
216eeca7dc5SRichard Henderson      * @tlb_fill: Handle a softmmu tlb miss
217eeca7dc5SRichard Henderson      *
218eeca7dc5SRichard Henderson      * If the access is valid, call tlb_set_page and return true;
219eeca7dc5SRichard Henderson      * if the access is invalid and probe is true, return false;
220eeca7dc5SRichard Henderson      * otherwise raise an exception and do not return.
221eeca7dc5SRichard Henderson      */
222eeca7dc5SRichard Henderson     bool (*tlb_fill)(CPUState *cpu, vaddr address, int size,
223eeca7dc5SRichard Henderson                      MMUAccessType access_type, int mmu_idx,
224eeca7dc5SRichard Henderson                      bool probe, uintptr_t retaddr);
225eeca7dc5SRichard Henderson     /**
226bdf26b5dSRichard Henderson      * @pointer_wrap:
227bdf26b5dSRichard Henderson      *
228bdf26b5dSRichard Henderson      * We have incremented @base to @result, resulting in a page change.
229bdf26b5dSRichard Henderson      * For the current cpu state, adjust @result for possible overflow.
230bdf26b5dSRichard Henderson      */
231bdf26b5dSRichard Henderson     vaddr (*pointer_wrap)(CPUState *cpu, int mmu_idx, vaddr result, vaddr base);
232bdf26b5dSRichard Henderson     /**
23378271684SClaudio Fontana      * @do_transaction_failed: Callback for handling failed memory transactions
23478271684SClaudio Fontana      * (ie bus faults or external aborts; not MMU faults)
23578271684SClaudio Fontana      */
23678271684SClaudio Fontana     void (*do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr,
23778271684SClaudio Fontana                                   unsigned size, MMUAccessType access_type,
23878271684SClaudio Fontana                                   int mmu_idx, MemTxAttrs attrs,
23978271684SClaudio Fontana                                   MemTxResult response, uintptr_t retaddr);
24078271684SClaudio Fontana     /**
24178271684SClaudio Fontana      * @do_unaligned_access: Callback for unaligned access handling
242fa947a66SRichard Henderson      * The callback must exit via raising an exception.
24378271684SClaudio Fontana      */
2448905770bSMarc-André Lureau     G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
24578271684SClaudio Fontana                                            MMUAccessType access_type,
2468905770bSMarc-André Lureau                                            int mmu_idx, uintptr_t retaddr);
24778271684SClaudio Fontana 
24878271684SClaudio Fontana     /**
24978271684SClaudio Fontana      * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM
25078271684SClaudio Fontana      */
25178271684SClaudio Fontana     vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len);
25278271684SClaudio Fontana 
25378271684SClaudio Fontana     /**
25478271684SClaudio Fontana      * @debug_check_watchpoint: return true if the architectural
25578271684SClaudio Fontana      * watchpoint whose address has matched should really fire, used by ARM
256013577deSBin Meng      * and RISC-V
25778271684SClaudio Fontana      */
25878271684SClaudio Fontana     bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp);
25978271684SClaudio Fontana 
260d9bcb58aSRichard Henderson     /**
261e3f7c801SRichard Henderson      * @debug_check_breakpoint: return true if the architectural
262e3f7c801SRichard Henderson      * breakpoint whose PC has matched should really fire.
263e3f7c801SRichard Henderson      */
264e3f7c801SRichard Henderson     bool (*debug_check_breakpoint)(CPUState *cpu);
265e3f7c801SRichard Henderson 
266e3f7c801SRichard Henderson     /**
267d9bcb58aSRichard Henderson      * @io_recompile_replay_branch: Callback for cpu_io_recompile.
268d9bcb58aSRichard Henderson      *
269d9bcb58aSRichard Henderson      * The cpu has been stopped, and cpu_restore_state_from_tb has been
270d9bcb58aSRichard Henderson      * called.  If the faulting instruction is in a delay slot, and the
271d9bcb58aSRichard Henderson      * target architecture requires re-execution of the branch, then
272d9bcb58aSRichard Henderson      * adjust the cpu state as required and return true.
273d9bcb58aSRichard Henderson      */
274d9bcb58aSRichard Henderson     bool (*io_recompile_replay_branch)(CPUState *cpu,
275d9bcb58aSRichard Henderson                                        const TranslationBlock *tb);
2760fdc69b7SPhilippe Mathieu-Daudé     /**
2770fdc69b7SPhilippe Mathieu-Daudé      * @need_replay_interrupt: Return %true if @interrupt_request
2780fdc69b7SPhilippe Mathieu-Daudé      * needs to be recorded for replay purposes.
2790fdc69b7SPhilippe Mathieu-Daudé      */
2800fdc69b7SPhilippe Mathieu-Daudé     bool (*need_replay_interrupt)(int interrupt_request);
28175fe97b4SPhilippe Mathieu-Daudé #endif /* !CONFIG_USER_ONLY */
28278271684SClaudio Fontana };
28378271684SClaudio Fontana 
2846eece7f5SPhilippe Mathieu-Daudé #if defined(CONFIG_USER_ONLY)
2856eece7f5SPhilippe Mathieu-Daudé 
cpu_check_watchpoint(CPUState * cpu,vaddr addr,vaddr len,MemTxAttrs atr,int fl,uintptr_t ra)2866eece7f5SPhilippe Mathieu-Daudé static inline void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len,
2876eece7f5SPhilippe Mathieu-Daudé                                         MemTxAttrs atr, int fl, uintptr_t ra)
2886eece7f5SPhilippe Mathieu-Daudé {
2896eece7f5SPhilippe Mathieu-Daudé }
2906eece7f5SPhilippe Mathieu-Daudé 
cpu_watchpoint_address_matches(CPUState * cpu,vaddr addr,vaddr len)2916eece7f5SPhilippe Mathieu-Daudé static inline int cpu_watchpoint_address_matches(CPUState *cpu,
2926eece7f5SPhilippe Mathieu-Daudé                                                  vaddr addr, vaddr len)
2936eece7f5SPhilippe Mathieu-Daudé {
2946eece7f5SPhilippe Mathieu-Daudé     return 0;
2956eece7f5SPhilippe Mathieu-Daudé }
2966eece7f5SPhilippe Mathieu-Daudé 
2976eece7f5SPhilippe Mathieu-Daudé #else
2986eece7f5SPhilippe Mathieu-Daudé 
2996eece7f5SPhilippe Mathieu-Daudé /**
3006eece7f5SPhilippe Mathieu-Daudé  * cpu_check_watchpoint:
3016eece7f5SPhilippe Mathieu-Daudé  * @cpu: cpu context
3026eece7f5SPhilippe Mathieu-Daudé  * @addr: guest virtual address
3036eece7f5SPhilippe Mathieu-Daudé  * @len: access length
3046eece7f5SPhilippe Mathieu-Daudé  * @attrs: memory access attributes
3056eece7f5SPhilippe Mathieu-Daudé  * @flags: watchpoint access type
3066eece7f5SPhilippe Mathieu-Daudé  * @ra: unwind return address
3076eece7f5SPhilippe Mathieu-Daudé  *
3086eece7f5SPhilippe Mathieu-Daudé  * Check for a watchpoint hit in [addr, addr+len) of the type
3096eece7f5SPhilippe Mathieu-Daudé  * specified by @flags.  Exit via exception with a hit.
3106eece7f5SPhilippe Mathieu-Daudé  */
3116eece7f5SPhilippe Mathieu-Daudé void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len,
3126eece7f5SPhilippe Mathieu-Daudé                           MemTxAttrs attrs, int flags, uintptr_t ra);
3136eece7f5SPhilippe Mathieu-Daudé 
3146eece7f5SPhilippe Mathieu-Daudé /**
3156eece7f5SPhilippe Mathieu-Daudé  * cpu_watchpoint_address_matches:
3166eece7f5SPhilippe Mathieu-Daudé  * @cpu: cpu context
3176eece7f5SPhilippe Mathieu-Daudé  * @addr: guest virtual address
3186eece7f5SPhilippe Mathieu-Daudé  * @len: access length
3196eece7f5SPhilippe Mathieu-Daudé  *
3206eece7f5SPhilippe Mathieu-Daudé  * Return the watchpoint flags that apply to [addr, addr+len).
3216eece7f5SPhilippe Mathieu-Daudé  * If no watchpoint is registered for the range, the result is 0.
3226eece7f5SPhilippe Mathieu-Daudé  */
3236eece7f5SPhilippe Mathieu-Daudé int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len);
3246eece7f5SPhilippe Mathieu-Daudé 
325a4027ed7SRichard Henderson /*
326a4027ed7SRichard Henderson  * Common pointer_wrap implementations.
327a4027ed7SRichard Henderson  */
328a4027ed7SRichard Henderson vaddr cpu_pointer_wrap_notreached(CPUState *, int, vaddr, vaddr);
329*981f2bebSRichard Henderson vaddr cpu_pointer_wrap_uint32(CPUState *, int, vaddr, vaddr);
330a4027ed7SRichard Henderson 
3316eece7f5SPhilippe Mathieu-Daudé #endif
3326eece7f5SPhilippe Mathieu-Daudé 
33378271684SClaudio Fontana #endif /* TCG_CPU_OPS_H */
334