Skip to content

Commit bf4a155

Browse files
philmdrth7680
authored andcommitted
accel/tcg: Restrict GETPC_ADJ to 'tb-internal.h'
GETPC_ADJ is only used within accel/tcg/, no need to expose it to all the code base. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 3fd60df commit bf4a155

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

accel/tcg/tb-internal.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
#include "exec/exec-all.h"
1414
#include "exec/translation-block.h"
1515

16+
/*
17+
* The true return address will often point to a host insn that is part of
18+
* the next translated guest insn. Adjust the address backward to point to
19+
* the middle of the call insn. Subtracting one would do the job except for
20+
* several compressed mode architectures (arm, mips) which set the low bit
21+
* to indicate the compressed mode; subtracting two works around that. It
22+
* is also the case that there are no host isas that contain a call insn
23+
* smaller than 4 bytes, so we don't worry about special-casing this.
24+
*/
25+
#define GETPC_ADJ 2
26+
1627
#ifdef CONFIG_SOFTMMU
1728

1829
#define CPU_TLB_DYN_MIN_BITS 6

include/exec/exec-all.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,6 @@ extern __thread uintptr_t tci_tb_ptr;
186186
((uintptr_t)__builtin_extract_return_addr(__builtin_return_address(0)))
187187
#endif
188188

189-
/* The true return address will often point to a host insn that is part of
190-
the next translated guest insn. Adjust the address backward to point to
191-
the middle of the call insn. Subtracting one would do the job except for
192-
several compressed mode architectures (arm, mips) which set the low bit
193-
to indicate the compressed mode; subtracting two works around that. It
194-
is also the case that there are no host isas that contain a call insn
195-
smaller than 4 bytes, so we don't worry about special-casing this. */
196-
#define GETPC_ADJ 2
197-
198189
#if !defined(CONFIG_USER_ONLY)
199190

200191
/**

0 commit comments

Comments
 (0)