sim: bpf: use CURRENT_TARGET_BYTE_ORDER

Code should be going through this macro rather than accessing the
underlying value directly.
This commit is contained in:
Mike Frysinger
2021-06-05 22:48:23 -04:00
parent 906192d785
commit eee649922f
3 changed files with 10 additions and 3 deletions

View File

@@ -1,3 +1,10 @@
2021-06-09 Mike Frysinger <vapier@gentoo.org>
* bpf.c (bpf_engine_run_full): Change current_target_byte_order to
CURRENT_TARGET_BYTE_ORDER.
(bpf_engine_run_fast): Likewise.
* mloop.in: Likewise.
2021-06-09 Mike Frysinger <vapier@gentoo.org>
* sim-if.c (sim_open): Delete cgen_init call.

View File

@@ -222,7 +222,7 @@ bpfbf_prepare_run (SIM_CPU *cpu)
void
bpf_engine_run_full (SIM_CPU *cpu)
{
if (current_target_byte_order == BFD_ENDIAN_LITTLE)
if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
{
if (!bpf_idesc_le)
{
@@ -253,7 +253,7 @@ bpf_engine_run_full (SIM_CPU *cpu)
void
bpf_engine_run_fast (SIM_CPU *cpu)
{
if (current_target_byte_order == BFD_ENDIAN_LITTLE)
if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
{
if (!bpf_idesc_le)
{

View File

@@ -121,7 +121,7 @@ cat <<EOF
UDI insn = GETIMEMUDI (current_cpu, vpc);
if (current_target_byte_order == BFD_ENDIAN_BIG)
if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
/* eBPF instructions are little-endian, but GETIMEMUDI reads according
to target byte order. Swap to little-endian. */