blob: bf89e411c5a0685420a852c8d1de70d0ecf987f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
From 6d2ed715191752850b4907496c13cca72e98bfe5 Mon Sep 17 00:00:00 2001
From: Tuan Hoang <tmhoang@linux.ibm.com>
Date: Thu, 14 Mar 2019 10:18:22 +0100
Subject: [PATCH] s390: fix SIGNAL_FRAMESIZE macro
Since __SIGNAL_FRAMESIZE is in private name space, it is better not to
use it directly. This macro has been stable on s390/s390x so it is safe
to use the integer value.
* linux/s390/arch_sigreturn.c [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE):
Define to 96.
* linux/s390x/arch_sigreturn.c (arch_sigreturn == s390_arch_sigreturn):
Remove S390_SIGNAL_FRAMESIZE and SIGNAL_FRAMESIZE.
(arch_sigreturn == s390x_arch_sigreturn): Define SIGNAL_FRAMESIZE.
* linux/s390/rt_sigframe.h (SIGNAL_FRAMESIZE): Define.
(struct_rt_sigframe): Replace __SIGNAL_FRAMESIZE with SIGNAL_FRAMESIZE.
Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com>
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
---
linux/s390/arch_sigreturn.c | 2 +-
linux/s390/rt_sigframe.h | 8 +++++++-
linux/s390x/arch_sigreturn.c | 4 +---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/linux/s390/arch_sigreturn.c b/linux/s390/arch_sigreturn.c
index 1d0f0e00..4a9ca8ec 100644
--- a/linux/s390/arch_sigreturn.c
+++ b/linux/s390/arch_sigreturn.c
@@ -6,7 +6,7 @@
*/
#ifndef SIGNAL_FRAMESIZE
-# define SIGNAL_FRAMESIZE __SIGNAL_FRAMESIZE
+# define SIGNAL_FRAMESIZE 96
#endif
#ifndef PTR_TYPE
# define PTR_TYPE unsigned long
diff --git a/linux/s390/rt_sigframe.h b/linux/s390/rt_sigframe.h
index e11573a4..51819b7b 100644
--- a/linux/s390/rt_sigframe.h
+++ b/linux/s390/rt_sigframe.h
@@ -10,8 +10,14 @@
# include <signal.h>
+#ifdef __s390x__
+# define SIGNAL_FRAMESIZE 160
+#else /* __s390__ */
+# define SIGNAL_FRAMESIZE 96
+#endif
+
typedef struct {
- uint8_t callee_used_stack[__SIGNAL_FRAMESIZE];
+ uint8_t callee_used_stack[SIGNAL_FRAMESIZE];
uint16_t svc_insn;
siginfo_t info;
ucontext_t uc;
diff --git a/linux/s390x/arch_sigreturn.c b/linux/s390x/arch_sigreturn.c
index 55930a35..2d75a8c6 100644
--- a/linux/s390x/arch_sigreturn.c
+++ b/linux/s390x/arch_sigreturn.c
@@ -7,9 +7,6 @@
#include <stdint.h>
-#define S390_SIGNAL_FRAMESIZE 96
-
-#define SIGNAL_FRAMESIZE S390_SIGNAL_FRAMESIZE
#define PTR_TYPE uint32_t
#define arch_sigreturn s390_arch_sigreturn
#include "s390/arch_sigreturn.c"
@@ -17,6 +14,7 @@
#undef PTR_TYPE
#undef SIGNAL_FRAMESIZE
+#define SIGNAL_FRAMESIZE 160
#define arch_sigreturn s390x_arch_sigreturn
#include "s390/arch_sigreturn.c"
#undef arch_sigreturn
--
2.20.1
|