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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1455232867-29059-1-git-send-email-bigeasy@linutronix.de>
Date:	Fri, 12 Feb 2016 00:21:06 +0100
From:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	linux-kernel@...r.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: [PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header

This patch moves the CALLER_ADDRx macros into their own header so it is
not required to include ftrace.h just for them.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
---
 include/linux/ftrace.h        | 25 +------------------------
 include/linux/ftrace_caller.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 24 deletions(-)
 create mode 100644 include/linux/ftrace_caller.h

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 81de7123959d..83193c717cb9 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -16,8 +16,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-
-#include <asm/ftrace.h>
+#include <linux/ftrace_caller.h>
 
 /*
  * If the arch supports passing the variable contents of
@@ -689,28 +688,6 @@ static inline void __ftrace_enabled_restore(int enabled)
 #endif
 }
 
-/* All archs should have this, but we define it for consistency */
-#ifndef ftrace_return_address0
-# define ftrace_return_address0 __builtin_return_address(0)
-#endif
-
-/* Archs may use other ways for ADDR1 and beyond */
-#ifndef ftrace_return_address
-# ifdef CONFIG_FRAME_POINTER
-#  define ftrace_return_address(n) __builtin_return_address(n)
-# else
-#  define ftrace_return_address(n) 0UL
-# endif
-#endif
-
-#define CALLER_ADDR0 ((unsigned long)ftrace_return_address0)
-#define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1))
-#define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2))
-#define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3))
-#define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4))
-#define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
-#define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
-
 #ifdef CONFIG_IRQSOFF_TRACER
   extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
   extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
diff --git a/include/linux/ftrace_caller.h b/include/linux/ftrace_caller.h
new file mode 100644
index 000000000000..887a7c220cd6
--- /dev/null
+++ b/include/linux/ftrace_caller.h
@@ -0,0 +1,28 @@
+#ifndef _LINUX_FTRACE_CALLER_H
+#define _LINUX_FTRACE_CALLER_H
+
+#include <asm/ftrace.h>
+
+/* All archs should have this, but we define it for consistency */
+#ifndef ftrace_return_address0
+# define ftrace_return_address0		__builtin_return_address(0)
+#endif
+
+/* Archs may use other ways for ADDR1 and beyond */
+#ifndef ftrace_return_address
+# ifdef CONFIG_FRAME_POINTER
+#  define ftrace_return_address(n)	__builtin_return_address(n)
+# else
+#  define ftrace_return_address(n)	0UL
+# endif
+#endif
+
+#define CALLER_ADDR0 ((unsigned long)ftrace_return_address0)
+#define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1))
+#define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2))
+#define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3))
+#define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4))
+#define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5))
+#define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6))
+
+#endif
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ