mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 06:36:09 +07:00
decb4c4115
Now that all type definitions are in the UAPI header, include it directly, instead of through <asm/sigcontext.h>. [ We still keep asm/sigcontext.h, so that uapi/asm/sigcontext32.h can include <asm/sigcontext.h>. ] Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/1441438363-9999-16-git-send-email-mingo@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
105 lines
2.2 KiB
C
105 lines
2.2 KiB
C
#ifndef _ASM_X86_SIGNAL_H
|
|
#define _ASM_X86_SIGNAL_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
#include <linux/linkage.h>
|
|
|
|
/* Most things should be clean enough to redefine this at will, if care
|
|
is taken to make libc match. */
|
|
|
|
#define _NSIG 64
|
|
|
|
#ifdef __i386__
|
|
# define _NSIG_BPW 32
|
|
#else
|
|
# define _NSIG_BPW 64
|
|
#endif
|
|
|
|
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
|
|
|
|
typedef unsigned long old_sigset_t; /* at least 32 bits */
|
|
|
|
typedef struct {
|
|
unsigned long sig[_NSIG_WORDS];
|
|
} sigset_t;
|
|
|
|
#ifndef CONFIG_COMPAT
|
|
typedef sigset_t compat_sigset_t;
|
|
#endif
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#include <uapi/asm/signal.h>
|
|
#ifndef __ASSEMBLY__
|
|
extern void do_signal(struct pt_regs *regs);
|
|
|
|
#define __ARCH_HAS_SA_RESTORER
|
|
|
|
#include <uapi/asm/sigcontext.h>
|
|
|
|
#ifdef __i386__
|
|
|
|
#define __HAVE_ARCH_SIG_BITOPS
|
|
|
|
#define sigaddset(set,sig) \
|
|
(__builtin_constant_p(sig) \
|
|
? __const_sigaddset((set), (sig)) \
|
|
: __gen_sigaddset((set), (sig)))
|
|
|
|
static inline void __gen_sigaddset(sigset_t *set, int _sig)
|
|
{
|
|
asm("btsl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
|
|
}
|
|
|
|
static inline void __const_sigaddset(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
set->sig[sig / _NSIG_BPW] |= 1 << (sig % _NSIG_BPW);
|
|
}
|
|
|
|
#define sigdelset(set, sig) \
|
|
(__builtin_constant_p(sig) \
|
|
? __const_sigdelset((set), (sig)) \
|
|
: __gen_sigdelset((set), (sig)))
|
|
|
|
|
|
static inline void __gen_sigdelset(sigset_t *set, int _sig)
|
|
{
|
|
asm("btrl %1,%0" : "+m"(*set) : "Ir"(_sig - 1) : "cc");
|
|
}
|
|
|
|
static inline void __const_sigdelset(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
set->sig[sig / _NSIG_BPW] &= ~(1 << (sig % _NSIG_BPW));
|
|
}
|
|
|
|
static inline int __const_sigismember(sigset_t *set, int _sig)
|
|
{
|
|
unsigned long sig = _sig - 1;
|
|
return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
|
|
}
|
|
|
|
static inline int __gen_sigismember(sigset_t *set, int _sig)
|
|
{
|
|
int ret;
|
|
asm("btl %2,%1\n\tsbbl %0,%0"
|
|
: "=r"(ret) : "m"(*set), "Ir"(_sig-1) : "cc");
|
|
return ret;
|
|
}
|
|
|
|
#define sigismember(set, sig) \
|
|
(__builtin_constant_p(sig) \
|
|
? __const_sigismember((set), (sig)) \
|
|
: __gen_sigismember((set), (sig)))
|
|
|
|
struct pt_regs;
|
|
|
|
#else /* __i386__ */
|
|
|
|
#undef __HAVE_ARCH_SIG_BITOPS
|
|
|
|
#endif /* !__i386__ */
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* _ASM_X86_SIGNAL_H */
|