[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 8/8] linux-user: Simplify host <-> target errno conversion
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v2 8/8] linux-user: Simplify host <-> target errno conversion using macros |
Date: |
Thu, 8 Jul 2021 17:30:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
Le 08/07/2021 à 16:11, Philippe Mathieu-Daudé a écrit :
> Convert the host_to_target_errno_table[] array to a switch case
> to allow compiler optimizations. Extract the errnos list as to
> a new includible unit, using a generic macro. Remove the code
> related to target_to_host_errno_table[] initialization.
>
Is there some performance penalties by using a switch() rather than an array[] ?
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> linux-user/syscall.c | 169 +++++-----------------------------------
> linux-user/errnos.c.inc | 140 +++++++++++++++++++++++++++++++++
> 2 files changed, 161 insertions(+), 148 deletions(-)
> create mode 100644 linux-user/errnos.c.inc
>
...
> diff --git a/linux-user/errnos.c.inc b/linux-user/errnos.c.inc
> new file mode 100644
> index 00000000000..807c97ca25e
> --- /dev/null
> +++ b/linux-user/errnos.c.inc
> @@ -0,0 +1,140 @@
...
> +#ifdef ERKFILL
You fix it in patch 1 but forgot to report it in your patch :)
Thanks,
Laurent
- [PATCH v2 5/8] linux-user/hppa: Move errno definitions to 'target_errno_defs.h', (continued)