OSDN Git Service

linux-user: Simplify host <-> target errno conversion using macros
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 8 Jul 2021 17:05:49 +0000 (19:05 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 12 Jul 2021 19:53:35 +0000 (21:53 +0200)
commit3ffe3268ea5e938de0c5fc309013805e4123531d
treee340d9fef2630e861cee3ca320c8b6a73acfdd53
parentf317c0ee575c07b6461a6f1c254b9230c2952c06
linux-user: Simplify host <-> target errno conversion using macros

Convert the host_to_target_errno_table[] array to a switch
case to allow compiler optimizations (such noticing the identity
function when host and guest errnos match). 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.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210708170550.1846343-8-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/errnos.c.inc [new file with mode: 0644]
linux-user/syscall.c