Commit 357c78f8 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

asm: move ksigfillset to non-arch header

ksigfillset is the same for all architectures and
here is no reasons to duplicate the same code many times.

In addition, this patch addes ksigemptyset and ksigaddset.
They will be used in the next patch.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 241163f2
...@@ -29,13 +29,6 @@ typedef struct { ...@@ -29,13 +29,6 @@ typedef struct {
unsigned long sig[_KNSIG_WORDS]; unsigned long sig[_KNSIG_WORDS];
} k_rtsigset_t; } k_rtsigset_t;
static inline void ksigfillset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = (unsigned long)-1;
}
#define SA_RESTORER 0x00000000 #define SA_RESTORER 0x00000000
typedef struct { typedef struct {
......
...@@ -30,13 +30,6 @@ typedef struct { ...@@ -30,13 +30,6 @@ typedef struct {
unsigned long sig[_KNSIG_WORDS]; unsigned long sig[_KNSIG_WORDS];
} k_rtsigset_t; } k_rtsigset_t;
static inline void ksigfillset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = (unsigned long)-1;
}
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
typedef struct { typedef struct {
......
...@@ -30,13 +30,6 @@ typedef struct { ...@@ -30,13 +30,6 @@ typedef struct {
uint64_t sig[_KNSIG_WORDS]; uint64_t sig[_KNSIG_WORDS];
} k_rtsigset_t; } k_rtsigset_t;
static inline void ksigfillset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = (unsigned long)-1;
}
/* Copied from the Linux kernel arch/powerpc/include/uapi/asm/signal.h */ /* Copied from the Linux kernel arch/powerpc/include/uapi/asm/signal.h */
#define SA_RESTORER 0x04000000U #define SA_RESTORER 0x04000000U
......
...@@ -31,13 +31,6 @@ typedef struct { ...@@ -31,13 +31,6 @@ typedef struct {
unsigned long sig[_KNSIG_WORDS]; unsigned long sig[_KNSIG_WORDS];
} k_rtsigset_t; } k_rtsigset_t;
static inline void ksigfillset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = (unsigned long)-1;
}
#define SA_RESTORER 0x04000000 #define SA_RESTORER 0x04000000
typedef struct { typedef struct {
......
#ifndef __CR_SIGNAL_H__
#define __CR_SIGNAL_H__
#include "asm/types.h"
static inline void ksigfillset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = (unsigned long)-1;
}
static inline void ksigemptyset(k_rtsigset_t *set)
{
int i;
for (i = 0; i < _KNSIG_WORDS; i++)
set->sig[i] = 0;
}
static inline void ksigaddset(k_rtsigset_t *set, int _sig)
{
int sig = _sig - 1;
set->sig[sig / _NSIG_BPW] = 1 << (sig % _NSIG_BPW);
}
#endif
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "aio.h" #include "aio.h"
#include "fault-injection.h" #include "fault-injection.h"
#include "syscall-codes.h" #include "syscall-codes.h"
#include "signal.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "asm/string.h" #include "asm/string.h"
#include "asm/types.h" #include "asm/types.h"
#include "syscall.h" #include "syscall.h"
#include "signal.h"
#include "config.h" #include "config.h"
#include "prctl.h" #include "prctl.h"
#include "log.h" #include "log.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment