hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/uapi/asm-generic/siginfo.h
....@@ -10,18 +10,7 @@
1010 void __user *sival_ptr;
1111 } sigval_t;
1212
13
-/*
14
- * This is the size (including padding) of the part of the
15
- * struct siginfo that is before the union.
16
- */
17
-#ifndef __ARCH_SI_PREAMBLE_SIZE
18
-#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
19
-#endif
20
-
2113 #define SI_MAX_SIZE 128
22
-#ifndef SI_PAD_SIZE
23
-#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
24
-#endif
2514
2615 /*
2716 * The default "si_band" type is "long", as specified by POSIX.
....@@ -40,96 +29,108 @@
4029 #define __ARCH_SI_ATTRIBUTES
4130 #endif
4231
43
-typedef struct siginfo {
44
- int si_signo;
45
-#ifndef __ARCH_HAS_SWAPPED_SIGINFO
46
- int si_errno;
47
- int si_code;
48
-#else
49
- int si_code;
50
- int si_errno;
51
-#endif
32
+union __sifields {
33
+ /* kill() */
34
+ struct {
35
+ __kernel_pid_t _pid; /* sender's pid */
36
+ __kernel_uid32_t _uid; /* sender's uid */
37
+ } _kill;
5238
53
- union {
54
- int _pad[SI_PAD_SIZE];
39
+ /* POSIX.1b timers */
40
+ struct {
41
+ __kernel_timer_t _tid; /* timer id */
42
+ int _overrun; /* overrun count */
43
+ sigval_t _sigval; /* same as below */
44
+ int _sys_private; /* not to be passed to user */
45
+ } _timer;
5546
56
- /* kill() */
57
- struct {
58
- __kernel_pid_t _pid; /* sender's pid */
59
- __kernel_uid32_t _uid; /* sender's uid */
60
- } _kill;
47
+ /* POSIX.1b signals */
48
+ struct {
49
+ __kernel_pid_t _pid; /* sender's pid */
50
+ __kernel_uid32_t _uid; /* sender's uid */
51
+ sigval_t _sigval;
52
+ } _rt;
6153
62
- /* POSIX.1b timers */
63
- struct {
64
- __kernel_timer_t _tid; /* timer id */
65
- int _overrun; /* overrun count */
66
- sigval_t _sigval; /* same as below */
67
- int _sys_private; /* not to be passed to user */
68
- } _timer;
54
+ /* SIGCHLD */
55
+ struct {
56
+ __kernel_pid_t _pid; /* which child */
57
+ __kernel_uid32_t _uid; /* sender's uid */
58
+ int _status; /* exit code */
59
+ __ARCH_SI_CLOCK_T _utime;
60
+ __ARCH_SI_CLOCK_T _stime;
61
+ } _sigchld;
6962
70
- /* POSIX.1b signals */
71
- struct {
72
- __kernel_pid_t _pid; /* sender's pid */
73
- __kernel_uid32_t _uid; /* sender's uid */
74
- sigval_t _sigval;
75
- } _rt;
76
-
77
- /* SIGCHLD */
78
- struct {
79
- __kernel_pid_t _pid; /* which child */
80
- __kernel_uid32_t _uid; /* sender's uid */
81
- int _status; /* exit code */
82
- __ARCH_SI_CLOCK_T _utime;
83
- __ARCH_SI_CLOCK_T _stime;
84
- } _sigchld;
85
-
86
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
87
- struct {
88
- void __user *_addr; /* faulting insn/memory ref. */
63
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
64
+ struct {
65
+ void __user *_addr; /* faulting insn/memory ref. */
8966 #ifdef __ARCH_SI_TRAPNO
90
- int _trapno; /* TRAP # which caused the signal */
67
+ int _trapno; /* TRAP # which caused the signal */
9168 #endif
9269 #ifdef __ia64__
93
- int _imm; /* immediate value for "break" */
94
- unsigned int _flags; /* see ia64 si_flags */
95
- unsigned long _isr; /* isr */
70
+ int _imm; /* immediate value for "break" */
71
+ unsigned int _flags; /* see ia64 si_flags */
72
+ unsigned long _isr; /* isr */
9673 #endif
9774
9875 #define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
9976 sizeof(short) : __alignof__(void *))
100
- union {
101
- /*
102
- * used when si_code=BUS_MCEERR_AR or
103
- * used when si_code=BUS_MCEERR_AO
104
- */
105
- short _addr_lsb; /* LSB of the reported address */
106
- /* used when si_code=SEGV_BNDERR */
107
- struct {
108
- char _dummy_bnd[__ADDR_BND_PKEY_PAD];
109
- void __user *_lower;
110
- void __user *_upper;
111
- } _addr_bnd;
112
- /* used when si_code=SEGV_PKUERR */
113
- struct {
114
- char _dummy_pkey[__ADDR_BND_PKEY_PAD];
115
- __u32 _pkey;
116
- } _addr_pkey;
117
- };
118
- } _sigfault;
77
+ union {
78
+ /*
79
+ * used when si_code=BUS_MCEERR_AR or
80
+ * used when si_code=BUS_MCEERR_AO
81
+ */
82
+ short _addr_lsb; /* LSB of the reported address */
83
+ /* used when si_code=SEGV_BNDERR */
84
+ struct {
85
+ char _dummy_bnd[__ADDR_BND_PKEY_PAD];
86
+ void __user *_lower;
87
+ void __user *_upper;
88
+ } _addr_bnd;
89
+ /* used when si_code=SEGV_PKUERR */
90
+ struct {
91
+ char _dummy_pkey[__ADDR_BND_PKEY_PAD];
92
+ __u32 _pkey;
93
+ } _addr_pkey;
94
+ };
95
+ } _sigfault;
11996
120
- /* SIGPOLL */
121
- struct {
122
- __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
123
- int _fd;
124
- } _sigpoll;
97
+ /* SIGPOLL */
98
+ struct {
99
+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
100
+ int _fd;
101
+ } _sigpoll;
125102
126
- /* SIGSYS */
127
- struct {
128
- void __user *_call_addr; /* calling user insn */
129
- int _syscall; /* triggering system call number */
130
- unsigned int _arch; /* AUDIT_ARCH_* of syscall */
131
- } _sigsys;
132
- } _sifields;
103
+ /* SIGSYS */
104
+ struct {
105
+ void __user *_call_addr; /* calling user insn */
106
+ int _syscall; /* triggering system call number */
107
+ unsigned int _arch; /* AUDIT_ARCH_* of syscall */
108
+ } _sigsys;
109
+};
110
+
111
+#ifndef __ARCH_HAS_SWAPPED_SIGINFO
112
+#define __SIGINFO \
113
+struct { \
114
+ int si_signo; \
115
+ int si_errno; \
116
+ int si_code; \
117
+ union __sifields _sifields; \
118
+}
119
+#else
120
+#define __SIGINFO \
121
+struct { \
122
+ int si_signo; \
123
+ int si_code; \
124
+ int si_errno; \
125
+ union __sifields _sifields; \
126
+}
127
+#endif /* __ARCH_HAS_SWAPPED_SIGINFO */
128
+
129
+typedef struct siginfo {
130
+ union {
131
+ __SIGINFO;
132
+ int _si_pad[SI_MAX_SIZE/sizeof(int)];
133
+ };
133134 } __ARCH_SI_ATTRIBUTES siginfo_t;
134135
135136 /*
....@@ -228,7 +229,9 @@
228229 #define SEGV_ACCADI 5 /* ADI not enabled for mapped object */
229230 #define SEGV_ADIDERR 6 /* Disrupting MCD error */
230231 #define SEGV_ADIPERR 7 /* Precise MCD exception */
231
-#define NSIGSEGV 7
232
+#define SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */
233
+#define SEGV_MTESERR 9 /* Synchronous ARM MTE exception */
234
+#define NSIGSEGV 9
232235
233236 /*
234237 * SIGBUS si_codes
....@@ -286,6 +289,12 @@
286289 #define NSIGSYS 1
287290
288291 /*
292
+ * SIGEMT si_codes
293
+ */
294
+#define EMT_TAGOVF 1 /* tag overflow */
295
+#define NSIGEMT 1
296
+
297
+/*
289298 * sigevent definitions
290299 *
291300 * It seems likely that SIGEV_THREAD will have to be handled from