diff mbox series

[v10,1/7] parisc: start using signal-defs.h

Message ID efdbcb5fc45a2dbdf1e2363d68ab0f7b5a276980.1598072840.git.pcc@google.com (mailing list archive)
State Not Applicable
Headers show
Series arm64: expose FAR_EL1 tag bits in siginfo | expand

Commit Message

Peter Collingbourne Aug. 22, 2020, 5:10 a.m. UTC
We currently include signal-defs.h on all architectures except parisc.
Make parisc fall in line. This will make maintenance easier once the
flag bits are moved here.

Signed-off-by: Peter Collingbourne <pcc@google.com>
---
View this change in Gerrit: https://linux-review.googlesource.com/q/If03a5135fb514fe96548fb74610e6c3586a04064

 arch/parisc/include/uapi/asm/signal.h  | 9 +--------
 include/uapi/asm-generic/signal-defs.h | 6 ++++++
 2 files changed, 7 insertions(+), 8 deletions(-)

Comments

Helge Deller Aug. 30, 2020, 5:07 p.m. UTC | #1
On 22.08.20 07:10, Peter Collingbourne wrote:
> We currently include signal-defs.h on all architectures except parisc.
> Make parisc fall in line. This will make maintenance easier once the
> flag bits are moved here.

The patch is basically OK, but....

> Signed-off-by: Peter Collingbourne <pcc@google.com>
> ---
> View this change in Gerrit: https://linux-review.googlesource.com/q/If03a5135fb514fe96548fb74610e6c3586a04064
>
>  arch/parisc/include/uapi/asm/signal.h  | 9 +--------
>  include/uapi/asm-generic/signal-defs.h | 6 ++++++
>  2 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
> index d38563a394f2..92a1c7ea44b4 100644
> --- a/arch/parisc/include/uapi/asm/signal.h
> +++ b/arch/parisc/include/uapi/asm/signal.h
> @@ -69,14 +69,7 @@
>  #define MINSIGSTKSZ	2048
>  #define SIGSTKSZ	8192
>
> -
> -#define SIG_BLOCK          0	/* for blocking signals */
> -#define SIG_UNBLOCK        1	/* for unblocking signals */
> -#define SIG_SETMASK        2	/* for setting the signal mask */
> -
> -#define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
> -#define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
> -#define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
> +#include <asm/signal-defs.h>
>
>  # ifndef __ASSEMBLY__
>
> diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
> index e9304c95ceea..ecdf6312bfa5 100644
> --- a/include/uapi/asm-generic/signal-defs.h
> +++ b/include/uapi/asm-generic/signal-defs.h
> @@ -15,8 +15,14 @@
>  #endif
>
>  #ifndef __ASSEMBLY__

> +#ifndef __hppa__
> +/*
> + * These have a special definition on parisc, see:
> + * arch/parisc/include/uapi/asm/signal.h
> + */
>  typedef void __signalfn_t(int);
>  typedef __signalfn_t __user *__sighandler_t;

please drop this special-case/#ifdef for hppa/parisc.
Instead please drop the typedef in arch/parisc/include/uapi/asm/signal.h,
same as you did for the other architectures.

I've committed this patch to my tree, which will collide with yours:
 https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git/commit/?h=for-next
If you like I can drop mine, and you fix it up on your side.
Just let me know.

Other than that you can add:
Acked-by: Helge Deller <deller@gmx.de>

Thanks!
Helge

> +#endif
>
>  typedef void __restorefn_t(void);
>  typedef __restorefn_t __user *__sigrestore_t;
>
Dave Martin Sept. 8, 2020, 3:12 p.m. UTC | #2
On Fri, Aug 21, 2020 at 10:10:11PM -0700, Peter Collingbourne wrote:
> We currently include signal-defs.h on all architectures except parisc.
> Make parisc fall in line. This will make maintenance easier once the
> flag bits are moved here.
> 
> Signed-off-by: Peter Collingbourne <pcc@google.com>
> ---
> View this change in Gerrit: https://linux-review.googlesource.com/q/If03a5135fb514fe96548fb74610e6c3586a04064
> 
>  arch/parisc/include/uapi/asm/signal.h  | 9 +--------
>  include/uapi/asm-generic/signal-defs.h | 6 ++++++
>  2 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
> index d38563a394f2..92a1c7ea44b4 100644
> --- a/arch/parisc/include/uapi/asm/signal.h
> +++ b/arch/parisc/include/uapi/asm/signal.h
> @@ -69,14 +69,7 @@
>  #define MINSIGSTKSZ	2048
>  #define SIGSTKSZ	8192
>  
> -
> -#define SIG_BLOCK          0	/* for blocking signals */
> -#define SIG_UNBLOCK        1	/* for unblocking signals */
> -#define SIG_SETMASK        2	/* for setting the signal mask */
> -
> -#define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
> -#define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
> -#define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
> +#include <asm/signal-defs.h>
>  
>  # ifndef __ASSEMBLY__
>  
> diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
> index e9304c95ceea..ecdf6312bfa5 100644
> --- a/include/uapi/asm-generic/signal-defs.h
> +++ b/include/uapi/asm-generic/signal-defs.h
> @@ -15,8 +15,14 @@
>  #endif
>  
>  #ifndef __ASSEMBLY__
> +#ifndef __hppa__
> +/*
> + * These have a special definition on parisc, see:
> + * arch/parisc/include/uapi/asm/signal.h
> + */
>  typedef void __signalfn_t(int);
>  typedef __signalfn_t __user *__sighandler_t;
> +#endif

Could we do something like

	#ifndef __sighandler_t
	/* ... */
	#define __sighandler_t __sighandler_t
	#endif

Then we don't have to have anything parisc-specific in the common
header, and arches can override this definition independently.

Not a big deal either way, though, and best to keep the comment about
why this is here in any case.

Cheers
---Dave
Peter Collingbourne Oct. 3, 2020, 1:22 a.m. UTC | #3
On Sun, Aug 30, 2020 at 10:07 AM Helge Deller <deller@gmx.de> wrote:
>
> On 22.08.20 07:10, Peter Collingbourne wrote:
> > We currently include signal-defs.h on all architectures except parisc.
> > Make parisc fall in line. This will make maintenance easier once the
> > flag bits are moved here.
>
> The patch is basically OK, but....
>
> > Signed-off-by: Peter Collingbourne <pcc@google.com>
> > ---
> > View this change in Gerrit: https://linux-review.googlesource.com/q/If03a5135fb514fe96548fb74610e6c3586a04064
> >
> >  arch/parisc/include/uapi/asm/signal.h  | 9 +--------
> >  include/uapi/asm-generic/signal-defs.h | 6 ++++++
> >  2 files changed, 7 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
> > index d38563a394f2..92a1c7ea44b4 100644
> > --- a/arch/parisc/include/uapi/asm/signal.h
> > +++ b/arch/parisc/include/uapi/asm/signal.h
> > @@ -69,14 +69,7 @@
> >  #define MINSIGSTKSZ  2048
> >  #define SIGSTKSZ     8192
> >
> > -
> > -#define SIG_BLOCK          0 /* for blocking signals */
> > -#define SIG_UNBLOCK        1 /* for unblocking signals */
> > -#define SIG_SETMASK        2 /* for setting the signal mask */
> > -
> > -#define SIG_DFL      ((__sighandler_t)0)     /* default signal handling */
> > -#define SIG_IGN      ((__sighandler_t)1)     /* ignore signal */
> > -#define SIG_ERR      ((__sighandler_t)-1)    /* error return from signal */
> > +#include <asm/signal-defs.h>
> >
> >  # ifndef __ASSEMBLY__
> >
> > diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
> > index e9304c95ceea..ecdf6312bfa5 100644
> > --- a/include/uapi/asm-generic/signal-defs.h
> > +++ b/include/uapi/asm-generic/signal-defs.h
> > @@ -15,8 +15,14 @@
> >  #endif
> >
> >  #ifndef __ASSEMBLY__
>
> > +#ifndef __hppa__
> > +/*
> > + * These have a special definition on parisc, see:
> > + * arch/parisc/include/uapi/asm/signal.h
> > + */
> >  typedef void __signalfn_t(int);
> >  typedef __signalfn_t __user *__sighandler_t;
>
> please drop this special-case/#ifdef for hppa/parisc.
> Instead please drop the typedef in arch/parisc/include/uapi/asm/signal.h,
> same as you did for the other architectures.
>
> I've committed this patch to my tree, which will collide with yours:
>  https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git/commit/?h=for-next
> If you like I can drop mine, and you fix it up on your side.
> Just let me know.
>
> Other than that you can add:
> Acked-by: Helge Deller <deller@gmx.de>
>
> Thanks!

Thanks for the review and apologies for the delay in getting back to
you. I've picked up your patch from your for-next branch into my
series before this change, and removed the special case for hppa. I
also build tested my series on hppa which revealed a typo in the
#include directive which I fixed. The new patch looks like this and it
will be included in v11 which I will try to send out soon.

diff --git a/arch/parisc/include/uapi/asm/signal.h
b/arch/parisc/include/uapi/asm/signal.h
index f1fd4fa880d7..e67b1bfb82ba 100644
--- a/arch/parisc/include/uapi/asm/signal.h
+++ b/arch/parisc/include/uapi/asm/signal.h
@@ -69,14 +69,7 @@
 #define MINSIGSTKSZ    2048
 #define SIGSTKSZ       8192

-
-#define SIG_BLOCK          0   /* for blocking signals */
-#define SIG_UNBLOCK        1   /* for unblocking signals */
-#define SIG_SETMASK        2   /* for setting the signal mask */
-
-#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
-#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
-#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
+#include <asm-generic/signal-defs.h>

 # ifndef __ASSEMBLY__

@@ -85,10 +78,6 @@
 /* Avoid too many header ordering problems.  */
 struct siginfo;

-/* Type of a signal handler.  */
-typedef void __signalfn_t(int);
-typedef __signalfn_t __user *__sighandler_t;
-
 typedef struct sigaltstack {
        void __user *ss_sp;
        int ss_flags;

Peter
Helge Deller Oct. 3, 2020, 10:04 a.m. UTC | #4
On 10/3/20 3:22 AM, Peter Collingbourne wrote:
> On Sun, Aug 30, 2020 at 10:07 AM Helge Deller <deller@gmx.de> wrote:
>>
>> On 22.08.20 07:10, Peter Collingbourne wrote:
>>> We currently include signal-defs.h on all architectures except parisc.
>>> Make parisc fall in line. This will make maintenance easier once the
>>> flag bits are moved here.
>>
>> The patch is basically OK, but....
>>
>>> Signed-off-by: Peter Collingbourne <pcc@google.com>
>>> ---
>>> View this change in Gerrit: https://linux-review.googlesource.com/q/If03a5135fb514fe96548fb74610e6c3586a04064
>>>
>>>  arch/parisc/include/uapi/asm/signal.h  | 9 +--------
>>>  include/uapi/asm-generic/signal-defs.h | 6 ++++++
>>>  2 files changed, 7 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
>>> index d38563a394f2..92a1c7ea44b4 100644
>>> --- a/arch/parisc/include/uapi/asm/signal.h
>>> +++ b/arch/parisc/include/uapi/asm/signal.h
>>> @@ -69,14 +69,7 @@
>>>  #define MINSIGSTKSZ  2048
>>>  #define SIGSTKSZ     8192
>>>
>>> -
>>> -#define SIG_BLOCK          0 /* for blocking signals */
>>> -#define SIG_UNBLOCK        1 /* for unblocking signals */
>>> -#define SIG_SETMASK        2 /* for setting the signal mask */
>>> -
>>> -#define SIG_DFL      ((__sighandler_t)0)     /* default signal handling */
>>> -#define SIG_IGN      ((__sighandler_t)1)     /* ignore signal */
>>> -#define SIG_ERR      ((__sighandler_t)-1)    /* error return from signal */
>>> +#include <asm/signal-defs.h>
>>>
>>>  # ifndef __ASSEMBLY__
>>>
>>> diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
>>> index e9304c95ceea..ecdf6312bfa5 100644
>>> --- a/include/uapi/asm-generic/signal-defs.h
>>> +++ b/include/uapi/asm-generic/signal-defs.h
>>> @@ -15,8 +15,14 @@
>>>  #endif
>>>
>>>  #ifndef __ASSEMBLY__
>>
>>> +#ifndef __hppa__
>>> +/*
>>> + * These have a special definition on parisc, see:
>>> + * arch/parisc/include/uapi/asm/signal.h
>>> + */
>>>  typedef void __signalfn_t(int);
>>>  typedef __signalfn_t __user *__sighandler_t;
>>
>> please drop this special-case/#ifdef for hppa/parisc.
>> Instead please drop the typedef in arch/parisc/include/uapi/asm/signal.h,
>> same as you did for the other architectures.
>>
>> I've committed this patch to my tree, which will collide with yours:
>>  https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git/commit/?h=for-next
>> If you like I can drop mine, and you fix it up on your side.
>> Just let me know.
>>
>> Other than that you can add:
>> Acked-by: Helge Deller <deller@gmx.de>
>>
>> Thanks!
>
> Thanks for the review and apologies for the delay in getting back to
> you. I've picked up your patch from your for-next branch into my
> series before this change, and removed the special case for hppa. I
> also build tested my series on hppa which revealed a typo in the
> #include directive which I fixed. The new patch looks like this and it
> will be included in v11 which I will try to send out soon.

Thanks!
Ok, I've now dropped my patch from my for-next series.

Helge


> diff --git a/arch/parisc/include/uapi/asm/signal.h
> b/arch/parisc/include/uapi/asm/signal.h
> index f1fd4fa880d7..e67b1bfb82ba 100644
> --- a/arch/parisc/include/uapi/asm/signal.h
> +++ b/arch/parisc/include/uapi/asm/signal.h
> @@ -69,14 +69,7 @@
>  #define MINSIGSTKSZ    2048
>  #define SIGSTKSZ       8192
>
> -
> -#define SIG_BLOCK          0   /* for blocking signals */
> -#define SIG_UNBLOCK        1   /* for unblocking signals */
> -#define SIG_SETMASK        2   /* for setting the signal mask */
> -
> -#define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
> -#define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
> -#define SIG_ERR        ((__sighandler_t)-1)    /* error return from signal */
> +#include <asm-generic/signal-defs.h>
>
>  # ifndef __ASSEMBLY__
>
> @@ -85,10 +78,6 @@
>  /* Avoid too many header ordering problems.  */
>  struct siginfo;
>
> -/* Type of a signal handler.  */
> -typedef void __signalfn_t(int);
> -typedef __signalfn_t __user *__sighandler_t;
> -
>  typedef struct sigaltstack {
>         void __user *ss_sp;
>         int ss_flags;
>
> Peter
>
diff mbox series

Patch

diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h
index d38563a394f2..92a1c7ea44b4 100644
--- a/arch/parisc/include/uapi/asm/signal.h
+++ b/arch/parisc/include/uapi/asm/signal.h
@@ -69,14 +69,7 @@ 
 #define MINSIGSTKSZ	2048
 #define SIGSTKSZ	8192
 
-
-#define SIG_BLOCK          0	/* for blocking signals */
-#define SIG_UNBLOCK        1	/* for unblocking signals */
-#define SIG_SETMASK        2	/* for setting the signal mask */
-
-#define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
-#define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
-#define SIG_ERR	((__sighandler_t)-1)	/* error return from signal */
+#include <asm/signal-defs.h>
 
 # ifndef __ASSEMBLY__
 
diff --git a/include/uapi/asm-generic/signal-defs.h b/include/uapi/asm-generic/signal-defs.h
index e9304c95ceea..ecdf6312bfa5 100644
--- a/include/uapi/asm-generic/signal-defs.h
+++ b/include/uapi/asm-generic/signal-defs.h
@@ -15,8 +15,14 @@ 
 #endif
 
 #ifndef __ASSEMBLY__
+#ifndef __hppa__
+/*
+ * These have a special definition on parisc, see:
+ * arch/parisc/include/uapi/asm/signal.h
+ */
 typedef void __signalfn_t(int);
 typedef __signalfn_t __user *__sighandler_t;
+#endif
 
 typedef void __restorefn_t(void);
 typedef __restorefn_t __user *__sigrestore_t;