qemu-e2k/bsd-user/openbsd/target_os_siginfo.h
Markus Armbruster 9c0928045c Clean up ill-advised or unusual header guards
Leading underscores are ill-advised because such identifiers are
reserved.  Trailing underscores are merely ugly.  Strip both.

Our header guards commonly end in _H.  Normalize the exceptions.

Macros should be ALL_CAPS.  Normalize the exception.

Done with scripts/clean-header-guards.pl.

include/hw/xen/interface/ and tools/virtiofsd/ left alone, because
these were imported from Xen and libfuse respectively.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220506134911.2856099-3-armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2022-05-11 16:50:01 +02:00

83 lines
2.0 KiB
C

#ifndef TARGET_OS_SIGINFO_H
#define TARGET_OS_SIGINFO_H
#define TARGET_NSIG 32 /* counting 0; could be 33 (mask is 1-32) */
#define TARGET_NSIG_BPW (sizeof(uint32_t) * 8)
#define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
/* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack {
abi_long ss_sp;
abi_ulong ss_size;
abi_long ss_flags;
} target_stack_t;
typedef struct {
uint32_t __bits[TARGET_NSIG_WORDS];
} target_sigset_t
struct target_sigaction {
abi_ulong _sa_handler;
int32_t sa_flags;
target_sigset_t sa_mask;
};
/* Compare to sys/siginfo.h */
typedef union target_sigval {
int sival_int;
abi_ulong sival_ptr;
} target_sigval_t;
struct target_ksiginfo {
int32_t _signo;
int32_t _code;
int32_t _errno;
#if TARGET_ABI_BITS == 64
int32_t _pad;
#endif
union {
struct {
int32_t _pid;
int32_t _uid;
target_sigval_t _value;
} _rt;
struct {
int32_t _pid;
int32_t _uid;
int32_t _struct;
/* clock_t _utime; */
/* clock_t _stime; */
} _child;
struct {
abi_ulong _addr;
int32_t _trap;
} _fault;
struct {
long _band;
int _fd;
} _poll;
} _reason;
};
typedef union target_siginfo {
int8_t si_pad[128];
struct target_ksiginfo _info;
} target_siginfo_t;
#define target_si_signo _info._signo
#define target_si_code _info._code
#define target_si_errno _info._errno
#define target_si_addr _info._reason._fault._addr
#define TARGET_SEGV_MAPERR 1
#define TARGET_SEGV_ACCERR 2
#define TARGET_TRAP_BRKPT 1
#define TARGET_TRAP_TRACE 2
#endif /* TARGET_OS_SIGINFO_H */