lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a5a2f8e2acb991327952c45a13f5441fc09dffd6@git.kernel.org>
Date:	Fri, 28 Aug 2009 12:28:30 GMT
From:	tip-bot for Jason Baron <jbaron@...hat.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	brueckner@...ux.vnet.ibm.com, mathieu.desnoyers@...ymtl.ca,
	mingo@...hat.com, peterz@...radead.org, fweisbec@...il.com,
	rostedt@...dmis.org, heiko.carstens@...ibm.com, tglx@...utronix.de,
	jbaron@...hat.com, laijs@...fujitsu.com,
	linux-kernel@...r.kernel.org, hpa@...or.com, jiayingz@...gle.com,
	lizf@...fujitsu.com, lethal@...ux-sh.org, jistone@...hat.com,
	mingo@...e.hu, mbligh@...gle.com
Subject: [tip:tracing/core] tracing: Define NR_syscalls for x86_64

Commit-ID:  a5a2f8e2acb991327952c45a13f5441fc09dffd6
Gitweb:     http://git.kernel.org/tip/a5a2f8e2acb991327952c45a13f5441fc09dffd6
Author:     Jason Baron <jbaron@...hat.com>
AuthorDate: Wed, 26 Aug 2009 12:09:10 -0400
Committer:  Frederic Weisbecker <fweisbec@...il.com>
CommitDate: Wed, 26 Aug 2009 21:29:58 +0200

tracing: Define NR_syscalls for x86_64

Express the available number of syscalls in a standard way by defining
NR_syscalls.

The common way to define it is to place its definition in asm/unistd.h
However, the number of syscalls is defined using __NR_syscall_max in
x86-64 after building a dynamic header file "asm-offsets.h"

The source file that generates this header, asm-offsets-64.c includes
unistd.h, then if we want to express NR_syscalls from __NR_syscall_max
in unistd.h only after generating the dynamic header file, we need a
watchguard.

If unistd.h is included from asm-offsets-64.c, then we are generating
asm-offset.h which defines __NR_syscall_max. At this time, we don't
want to (we can't) define NR_syscalls, then we do nothing.
Otherwise we define NR_syscalls because we know asm-offsets.h has
been generated.

Signed-off-by: Jason Baron <jbaron@...hat.com>
Acked-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Paul Mundt <lethal@...ux-sh.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc: Jiaying Zhang <jiayingz@...gle.com>
Cc: Martin Bligh <mbligh@...gle.com>
Cc: Li Zefan <lizf@...fujitsu.com>
Cc: Josh Stone <jistone@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: H. Peter Anwin <hpa@...or.com>
Cc: Hendrik Brueckner <brueckner@...ux.vnet.ibm.com>
Cc: Heiko Carstens <heiko.carstens@...ibm.com>
LKML-Reference: <20090826160910.GB2658@...hat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>


---
 arch/x86/include/asm/unistd_64.h |    6 ++++++
 arch/x86/kernel/asm-offsets_64.c |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h
index 900e161..b9f3c60 100644
--- a/arch/x86/include/asm/unistd_64.h
+++ b/arch/x86/include/asm/unistd_64.h
@@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open)
 #endif	/* __NO_STUBS */
 
 #ifdef __KERNEL__
+
+#ifndef COMPILE_OFFSETS
+#include <asm/asm-offsets.h>
+#define NR_syscalls (__NR_syscall_max + 1)
+#endif
+
 /*
  * "Conditional" syscalls
  *
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 898ecc4..4a6aeed 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -3,6 +3,7 @@
  * This code generates raw asm output which is post-processed to extract
  * and format the required data.
  */
+#define COMPILE_OFFSETS
 
 #include <linux/crypto.h>
 #include <linux/sched.h> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ