am 819c132e: Merge "Fix NSIG."

* commit '819c132ebc18a458f651e6dacd75a0950269656b':
  Fix NSIG.
This commit is contained in:
Elliott Hughes 2014-03-07 02:29:17 +00:00 committed by Android Git Automerger
commit 72dc7cd5fb
8 changed files with 25 additions and 19 deletions

View File

@ -51,14 +51,15 @@ __BEGIN_DECLS
typedef int sig_atomic_t;
/* TODO: 64-bit: we should probably #undef the uapi NSIG and add a unit test that NSIG == _NSIG && NSIG >= 64. */
#ifndef _NSIG
# define _NSIG 64
#endif
#ifndef NSIG
# define NSIG _NSIG
/* The arm and x86 kernel header files don't define _NSIG. */
#ifndef _KERNEL__NSIG
#define _KERNEL__NSIG 64
#endif
/* Userspace's NSIG is the kernel's _NSIG + 1. */
#define _NSIG (_KERNEL__NSIG + 1)
#define NSIG _NSIG
extern const char* const sys_siglist[];
extern const char* const sys_signame[];

View File

@ -1521,7 +1521,7 @@ class BlockList:
"""replace tokens according to the given dict
"""
for b in self.blocks:
if not b.isDirective():
if (not b.isDirective()) or b.isDefine():
for tok in b.tokens:
if tok.id == tokIDENT:
if tok.value in replacements:

View File

@ -57,10 +57,15 @@ kernel_arch_token_replacements = {
"mips": {"off_t":"__kernel_off_t"},
"x86": {},
}
# Replace tokens in the output according to this mapping
kernel_token_replacements = {
"asm": "__asm__",
"__unused": "__linux_unused", # The kernel usage of __unused conflicts with the macro defined in sys/cdefs.h
# The kernel usage of __unused for unused struct fields conflicts with the macro defined in <sys/cdefs.h>.
"__unused": "__linux_unused",
# The kernel's _NSIG/NSIG are one less than the userspace value, so we need to move them aside.
"_NSIG": "_KERNEL__NSIG",
"NSIG": "_KERNEL_NSIG",
}
# this is the set of known static inline functions that we want to keep

View File

@ -21,7 +21,7 @@
#include <linux/types.h>
struct siginfo;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define NSIG 32
#define _KERNEL_NSIG 32
typedef unsigned long sigset_t;
#define SIGHUP 1
#define SIGINT 2
@ -67,7 +67,7 @@ typedef unsigned long sigset_t;
#define SIGUNUSED 31
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SIGRTMIN 32
#define SIGRTMAX _NSIG
#define SIGRTMAX _KERNEL__NSIG
#define SIGSWI 32
#define SA_NOCLDSTOP 0x00000001
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

View File

@ -19,10 +19,10 @@
#ifndef _UAPI__ASM_GENERIC_SIGNAL_H
#define _UAPI__ASM_GENERIC_SIGNAL_H
#include <linux/types.h>
#define _NSIG 64
#define _KERNEL__NSIG 64
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define _NSIG_BPW __BITS_PER_LONG
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
#define _NSIG_WORDS (_KERNEL__NSIG / _NSIG_BPW)
#define SIGHUP 1
#define SIGINT 2
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@ -68,7 +68,7 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SIGRTMIN 32
#ifndef SIGRTMAX
#define SIGRTMAX _NSIG
#define SIGRTMAX _KERNEL__NSIG
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SA_NOCLDSTOP 0x00000001

View File

@ -19,10 +19,10 @@
#ifndef _UAPI_ASM_SIGNAL_H
#define _UAPI_ASM_SIGNAL_H
#include <linux/types.h>
#define _NSIG 128
#define _KERNEL__NSIG 128
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define _NSIG_BPW (sizeof(unsigned long) * 8)
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
#define _NSIG_WORDS (_KERNEL__NSIG / _NSIG_BPW)
typedef struct {
unsigned long sig[_NSIG_WORDS];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
@ -72,7 +72,7 @@ typedef unsigned long old_sigset_t;
#define SIGXFSZ 31
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SIGRTMIN 32
#define SIGRTMAX _NSIG
#define SIGRTMAX _KERNEL__NSIG
#define SA_ONSTACK 0x08000000
#define SA_RESETHAND 0x80000000
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

View File

@ -24,7 +24,7 @@
#include <linux/time.h>
#include <linux/compiler.h>
struct siginfo;
#define NSIG 32
#define _KERNEL_NSIG 32
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
typedef unsigned long sigset_t;
#endif
@ -72,7 +72,7 @@ typedef unsigned long sigset_t;
#define SIGUNUSED 31
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define SIGRTMIN 32
#define SIGRTMAX _NSIG
#define SIGRTMAX _KERNEL__NSIG
#define SA_NOCLDSTOP 0x00000001u
#define SA_NOCLDWAIT 0x00000002u
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

View File

@ -102,7 +102,7 @@ struct stat {
long __linux_unused[3];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define INIT_STRUCT_STAT_PADDING(st) do { st.__pad0 = 0; st.__unused[0] = 0; st.__unused[1] = 0; st.__unused[2] = 0; } while (0)
#define INIT_STRUCT_STAT_PADDING(st) do { st.__pad0 = 0; st.__linux_unused[0] = 0; st.__linux_unused[1] = 0; st.__linux_unused[2] = 0; } while (0)
#endif
struct __old_kernel_stat {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */