qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Anthony Liguori <aliguori@us.ibm.com>, Blue Swirl <blauwirbel@gmail.com>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 03/10] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop
Date: Tue, 14 Aug 2012 10:40:29 +0100	[thread overview]
Message-ID: <1344937236-611-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1344937236-611-1-git-send-email-peter.maydell@linaro.org>

The code to initialise the target_to_host_errno_table[] array was
accidentally inside the loop through checking and initialising all
the supported ioctls. This was harmless but meant that we reinitialised the
array several hundred times on startup.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/syscall.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3ba3ef5..1af68d2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4606,6 +4606,11 @@ void syscall_init(void)
 #undef STRUCT
 #undef STRUCT_SPECIAL
 
+    /* Build target_to_host_errno_table[] table from
+     * host_to_target_errno_table[]. */
+    for (i=0; i < ERRNO_TABLE_SIZE; i++)
+        target_to_host_errno_table[host_to_target_errno_table[i]] = i;
+
     /* we patch the ioctl size if necessary. We rely on the fact that
        no ioctl has all the bits at '1' in the size field */
     ie = ioctl_entries;
@@ -4625,11 +4630,6 @@ void syscall_init(void)
                 (size << TARGET_IOC_SIZESHIFT);
         }
 
-        /* Build target_to_host_errno_table[] table from
-         * host_to_target_errno_table[]. */
-        for (i=0; i < ERRNO_TABLE_SIZE; i++)
-                target_to_host_errno_table[host_to_target_errno_table[i]] = i;
-
         /* automatic consistency check if same arch */
 #if (defined(__i386__) && defined(TARGET_I386) && defined(TARGET_ABI32)) || \
     (defined(__x86_64__) && defined(TARGET_X86_64))
-- 
1.7.9.5

  parent reply	other threads:[~2012-08-14  9:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14  9:40 [Qemu-devel] [PULL for-1.2 00/10] linux-user queue Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 01/10] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 02/10] linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions Peter Maydell
2012-08-14  9:40 ` Peter Maydell [this message]
2012-08-14 18:27   ` [Qemu-devel] [PATCH 03/10] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop Blue Swirl
2012-08-14 18:38     ` Peter Maydell
2012-08-14 18:58       ` Blue Swirl
2012-08-14 19:35         ` Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 04/10] linux-user: pass sockaddr from host to target Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 05/10] linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 06/10] linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 07/10] flatload: fix bss clearing Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 08/10] linux-user: Factor out guest space probing into a function Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 09/10] linux-user: Use init_guest_space when -R and -B are specified Peter Maydell
2012-08-14  9:40 ` [Qemu-devel] [PATCH 10/10] linux-user: ARM: Ignore immediate value for svc in thumb mode Peter Maydell
2012-08-14 19:56 ` [Qemu-devel] [PULL for-1.2 00/10] linux-user queue Blue Swirl

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=1344937236-611-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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 NNTP newsgroup(s).