Skip to content

Commit 63d8b11

Browse files
committed
linux-user/arm: Remove unused get_put_user macros
In linux-user/arm/cpu_loop.c we define a full set of get/put macros for both code and data (since the endianness handling is different between the two). However the only one we actually use is get_user_code_u32(). Remove the rest. We leave a comment noting how data-side accesses should be handled for big-endian, because that's a subtle point and we just removed the macros that were effectively documenting it. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Richard Henderson <[email protected]>
1 parent fe0f88a commit 63d8b11

File tree

1 file changed

+4
-39
lines changed

1 file changed

+4
-39
lines changed

linux-user/arm/cpu_loop.c

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,45 +36,10 @@
3636
__r; \
3737
})
3838

39-
#define get_user_code_u16(x, gaddr, env) \
40-
({ abi_long __r = get_user_u16((x), (gaddr)); \
41-
if (!__r && bswap_code(arm_sctlr_b(env))) { \
42-
(x) = bswap16(x); \
43-
} \
44-
__r; \
45-
})
46-
47-
#define get_user_data_u32(x, gaddr, env) \
48-
({ abi_long __r = get_user_u32((x), (gaddr)); \
49-
if (!__r && arm_cpu_bswap_data(env)) { \
50-
(x) = bswap32(x); \
51-
} \
52-
__r; \
53-
})
54-
55-
#define get_user_data_u16(x, gaddr, env) \
56-
({ abi_long __r = get_user_u16((x), (gaddr)); \
57-
if (!__r && arm_cpu_bswap_data(env)) { \
58-
(x) = bswap16(x); \
59-
} \
60-
__r; \
61-
})
62-
63-
#define put_user_data_u32(x, gaddr, env) \
64-
({ typeof(x) __x = (x); \
65-
if (arm_cpu_bswap_data(env)) { \
66-
__x = bswap32(__x); \
67-
} \
68-
put_user_u32(__x, (gaddr)); \
69-
})
70-
71-
#define put_user_data_u16(x, gaddr, env) \
72-
({ typeof(x) __x = (x); \
73-
if (arm_cpu_bswap_data(env)) { \
74-
__x = bswap16(__x); \
75-
} \
76-
put_user_u16(__x, (gaddr)); \
77-
})
39+
/*
40+
* Note that if we need to do data accesses here, they should do a
41+
* bswap if arm_cpu_bswap_data() returns true.
42+
*/
7843

7944
/*
8045
* Similar to code in accel/tcg/user-exec.c, but outside the execution loop.

0 commit comments

Comments
 (0)