aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-07-23 18:54:00 +0100
committerPeter Maydell <peter.maydell@linaro.org>2012-07-23 18:54:00 +0100
commit9df109bd74a955d09d5c12ad74252e39c629641a (patch)
treeb7806dffa3cbc4fcfedbc3e29f26aa0c16a761eb
parent85db42e3df64f34a8dc81164f41c6a11bf57fd1a (diff)
downloadqemu-arm-test-ping-fixes.tar.gz
linux-user: Move target_to_host_errno_table[] setup out of ioctl looptest-ping-fixes
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>
-rw-r--r--linux-user/syscall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6158e97c83..6d70ef0979 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4639,6 +4639,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;
@@ -4658,11 +4663,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))