提交 b68a68d3 编写于 作者: E Eric W. Biederman

signal: Move addr_lsb into the _sigfault union for clarity

The addr_lsb fields is only valid and available when the
signal is SIGBUS and the si_code is BUS_MCEERR_AR or BUS_MCEERR_AO.
Document this with a comment and place the field in the _sigfault union
to make this clear.

All of the fields stay in the same physical location so both the old
and new definitions of struct siginfo will continue to work.
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
上级 b713da69
...@@ -221,15 +221,23 @@ typedef struct compat_siginfo { ...@@ -221,15 +221,23 @@ typedef struct compat_siginfo {
#ifdef __ARCH_SI_TRAPNO #ifdef __ARCH_SI_TRAPNO
int _trapno; /* TRAP # which caused the signal */ int _trapno; /* TRAP # which caused the signal */
#endif #endif
short int _addr_lsb; /* Valid LSB of the reported address. */
union { union {
/*
* used when si_code=BUS_MCEERR_AR or
* used when si_code=BUS_MCEERR_AO
*/
short int _addr_lsb; /* Valid LSB of the reported address. */
/* used when si_code=SEGV_BNDERR */ /* used when si_code=SEGV_BNDERR */
struct { struct {
short _dummy_bnd;
compat_uptr_t _lower; compat_uptr_t _lower;
compat_uptr_t _upper; compat_uptr_t _upper;
} _addr_bnd; } _addr_bnd;
/* used when si_code=SEGV_PKUERR */ /* used when si_code=SEGV_PKUERR */
struct {
short _dummy_pkey;
u32 _pkey; u32 _pkey;
} _addr_pkey;
}; };
} _sigfault; } _sigfault;
......
...@@ -94,15 +94,23 @@ typedef struct siginfo { ...@@ -94,15 +94,23 @@ typedef struct siginfo {
unsigned int _flags; /* see ia64 si_flags */ unsigned int _flags; /* see ia64 si_flags */
unsigned long _isr; /* isr */ unsigned long _isr; /* isr */
#endif #endif
short _addr_lsb; /* LSB of the reported address */
union { union {
/*
* used when si_code=BUS_MCEERR_AR or
* used when si_code=BUS_MCEERR_AO
*/
short _addr_lsb; /* LSB of the reported address */
/* used when si_code=SEGV_BNDERR */ /* used when si_code=SEGV_BNDERR */
struct { struct {
short _dummy_bnd;
void __user *_lower; void __user *_lower;
void __user *_upper; void __user *_upper;
} _addr_bnd; } _addr_bnd;
/* used when si_code=SEGV_PKUERR */ /* used when si_code=SEGV_PKUERR */
struct {
short _dummy_pkey;
__u32 _pkey; __u32 _pkey;
} _addr_pkey;
}; };
} _sigfault; } _sigfault;
...@@ -142,7 +150,7 @@ typedef struct siginfo { ...@@ -142,7 +150,7 @@ typedef struct siginfo {
#define si_addr_lsb _sifields._sigfault._addr_lsb #define si_addr_lsb _sifields._sigfault._addr_lsb
#define si_lower _sifields._sigfault._addr_bnd._lower #define si_lower _sifields._sigfault._addr_bnd._lower
#define si_upper _sifields._sigfault._addr_bnd._upper #define si_upper _sifields._sigfault._addr_bnd._upper
#define si_pkey _sifields._sigfault._pkey #define si_pkey _sifields._sigfault._addr_pkey._pkey
#define si_band _sifields._sigpoll._band #define si_band _sifields._sigpoll._band
#define si_fd _sifields._sigpoll._fd #define si_fd _sifields._sigpoll._fd
#define si_call_addr _sifields._sigsys._call_addr #define si_call_addr _sifields._sigsys._call_addr
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册