[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] linux-user: cleanup signal.c
From: |
Laurent Vivier |
Subject: |
Re: [PATCH 2/4] linux-user: cleanup signal.c |
Date: |
Tue, 4 Feb 2020 14:35:04 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 |
Le 03/02/2020 à 23:58, Taylor Simpson a écrit :
>
>
>> -----Original Message-----
>> From: Laurent Vivier <address@hidden>
>> Sent: Saturday, February 1, 2020 6:28 AM
>> To: address@hidden
>> Cc: Josh Kunz <address@hidden>; address@hidden; Matus Kysel
>> <address@hidden>; Aleksandar Markovic <aleksandar.markovic@rt-
>> rk.com>; Marlies Ruck <address@hidden>; Laurent Vivier
>> <address@hidden>; Peter Maydell <address@hidden>; Taylor
>> Simpson <address@hidden>; Riku Voipio <address@hidden>
>> Subject: [PATCH 2/4] linux-user: cleanup signal.c
>>
>> -------------------------------------------------------------------------
>> CAUTION: This email originated from outside of the organization.
>> -------------------------------------------------------------------------
>>
>> No functionnal changes. Prepare the field for future fixes.
>
>
> Spelling error
Sorry, french word. Will be changed by "functional"
>
>>
>> Remove memset(.., 0, ...) that is useless on a static array
>>
>> Signed-off-by: Laurent Vivier <address@hidden>
>> ---
>> linux-user/signal.c | 37 ++++++++++++++++++++++---------------
>> 1 file changed, 22 insertions(+), 15 deletions(-)
>>
>> diff --git a/linux-user/signal.c b/linux-user/signal.c index
>> 5ca6d62b15d3..f42a2e1a82a5 100644
>> --- a/linux-user/signal.c
>> +++ b/linux-user/signal.c
>> @@ -66,12 +66,6 @@ static uint8_t host_to_target_signal_table[_NSIG] = {
>> [SIGPWR] = TARGET_SIGPWR,
>> [SIGSYS] = TARGET_SIGSYS,
>> /* next signals stay the same */
>> - /* Nasty hack: Reverse SIGRTMIN and SIGRTMAX to avoid overlap with
>> - host libpthread signals. This assumes no one actually uses SIGRTMAX
>> :-/
>> - To fix this properly we need to do manual signal delivery multiplexed
>> - over a single host signal. */
>> - [__SIGRTMIN] = __SIGRTMAX,
>> - [__SIGRTMAX] = __SIGRTMIN,
>> };
>> static uint8_t target_to_host_signal_table[_NSIG];
>>
>> @@ -480,13 +474,18 @@ static int core_dump_signal(int sig)
>> }
>> }
>>
>> -void signal_init(void)
>> +static void signal_table_init(void)
>> {
>> - TaskState *ts = (TaskState *)thread_cpu->opaque;
>> - struct sigaction act;
>> - struct sigaction oact;
>> int i, j;
>> - int host_sig;
>> +
>> + /*
>> + * Nasty hack: Reverse SIGRTMIN and SIGRTMAX to avoid overlap with
>> + * host libpthread signals. This assumes no one actually uses SIGRTMAX
>> :-
>> /
>> + * To fix this properly we need to do manual signal delivery multiplexed
>> + * over a single host signal.
>> + */
>> + host_to_target_signal_table[__SIGRTMIN] = __SIGRTMAX;
>> + host_to_target_signal_table[__SIGRTMAX] = __SIGRTMIN;
>>
>> /* generate signal conversion tables */
>> for(i = 1; i < _NSIG; i++) {
>> @@ -497,14 +496,22 @@ void signal_init(void)
>> j = host_to_target_signal_table[i];
>
> Since you are cleaning up this code, let's give this a more descriptive name
> - target_sig would be consistent with host_sig used elsewhere.
I agree.
Thanks,
Laurent
- [PATCH 0/4] linux-user: fix use of SIGRTMIN, Laurent Vivier, 2020/02/01
- [PATCH 1/4] linux-user: add missing TARGET_SIGRTMIN for hppa, Laurent Vivier, 2020/02/01
- [PATCH 3/4] linux-user: fix TARGET_NSIG and _NSIG uses, Laurent Vivier, 2020/02/01
- [PATCH 4/4] linux-user: fix use of SIGRTMIN, Laurent Vivier, 2020/02/01
- [PATCH 2/4] linux-user: cleanup signal.c, Laurent Vivier, 2020/02/01
- RE: [PATCH 0/4] linux-user: fix use of SIGRTMIN, Taylor Simpson, 2020/02/03
- Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN, Josh Kunz, 2020/02/03