public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: bpf: use CURRENT_TARGET_BYTE_ORDER
Date: Sun,  6 Jun 2021 13:32:59 -0400	[thread overview]
Message-ID: <20210606173259.24492-1-vapier@gentoo.org> (raw)

Code should be going through this macro rather than accessing the
underlying value directly.
---
 sim/bpf/bpf.c    | 4 ++--
 sim/bpf/mloop.in | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sim/bpf/bpf.c b/sim/bpf/bpf.c
index c626781adbf8..f9cdb824d1a9 100644
--- a/sim/bpf/bpf.c
+++ b/sim/bpf/bpf.c
@@ -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)
         {
diff --git a/sim/bpf/mloop.in b/sim/bpf/mloop.in
index e666835ed1b8..91f0c445eed0 100644
--- a/sim/bpf/mloop.in
+++ b/sim/bpf/mloop.in
@@ -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. */
-- 
2.31.1


                 reply	other threads:[~2021-06-06 17:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210606173259.24492-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).