public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] markers-powerpc-doc-section-flags
Date: Tue, 10 Apr 2007 19:22:45 -0400	[thread overview]
Message-ID: <20070410232245.GE7092@Krystal> (raw)
In-Reply-To: <20070410231126.GC7092@Krystal>

Changes to the powerpc marker header : Use the new MF_* bitmask, use the
__markers, __markers_data and __markers_strings sections, add
documentation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>

--- a/include/asm-powerpc/marker.h
+++ b/include/asm-powerpc/marker.h
@@ -1,3 +1,6 @@
+#ifndef _ASM_POWERPC_MARKER_H
+#define _ASM_POWERPC_MARKER_H
+
 /*
  * marker.h
  *
@@ -14,42 +17,54 @@
 
 #ifdef CONFIG_MARKERS
 
-#define _MF_DEFAULT (_MF_OPTIMIZED | _MF_LOCKDEP | _MF_PRINTK)
+#define MF_DEFAULT (MF_OPTIMIZED | MF_LOCKDEP | MF_PRINTK)
 
+/* Optimized version of the markers */
 #define MARK_OPTIMIZED(flags, name, format, args...) \
 	do { \
-		static marker_probe_func *__mark_call_##name = \
-					__mark_empty_function; \
-		static const struct __mark_marker_c __mark_c_##name \
-			__attribute__((section(".markers.c"))) = \
-			{ #name, &__mark_call_##name, format, \
-			(flags) | _MF_OPTIMIZED } ; \
+		static const char __mstrtab_name_##name[] \
+		__attribute__((section("__markers_strings"))) \
+		= #name; \
+		static const char __mstrtab_format_##name[] \
+		__attribute__((section("__markers_strings"))) \
+		= format; \
+		static struct __mark_marker_data __mark_data_##name \
+		__attribute__((section("__markers_data"))) = \
+		{ __mstrtab_name_##name,  __mstrtab_format_##name, \
+		(flags) | MF_OPTIMIZED, __mark_empty_function, NULL }; \
 		char condition; \
-		asm volatile(	".section .markers, \"a\", @progbits;\n\t" \
+		asm volatile(	".section __markers, \"a\", @progbits;\n\t" \
 					PPC_LONG "%1, 0f;\n\t" \
 					".previous;\n\t" \
 					".align 4\n\t" \
 					"0:\n\t" \
 					"li %0,0;\n\t" \
 				: "=r" (condition) \
-				: "i" (&__mark_c_##name)); \
+				: "i" (&__mark_data_##name)); \
 		__mark_check_format(format, ## args); \
 		if (unlikely(condition)) { \
 			preempt_disable(); \
-			(*__mark_call_##name)(format, ## args); \
+			(*__mark_data_##name.call)(&__mark_data_##name, \
+						format, ## args); \
 			preempt_enable(); \
 		} \
 	} while (0)
 
+/* Marker macro selecting the generic or optimized version of marker, depending
+ * on the flags specified. */
 #define _MARK(flags, format, args...) \
 do { \
-	if ((flags) & _MF_OPTIMIZED) \
+	if ((flags) & MF_OPTIMIZED) \
 		MARK_OPTIMIZED(flags, format, ## args); \
 	else \
 		MARK_GENERIC(flags, format, ## args); \
 } while (0)
 
-#define MARK(format, args...) _MARK(_MF_DEFAULT, format, ## args)
+/* Marker with default behavior */
+#define MARK(format, args...) _MARK(MF_DEFAULT, format, ## args)
+
+/* Architecture dependant marker information, used internally for marker
+ * activation. */
 
 /* Offset of the immediate value from the start of the addi instruction (result
  * of the li mnemonic), in bytes. */
@@ -63,3 +78,4 @@ do { \
 extern int marker_optimized_set_enable(void *address, char enable);
 
 #endif
+#endif //_ASM_POWERPC_MARKER_H
-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  parent reply	other threads:[~2007-04-10 23:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 23:11 [PATCH] markers-generic-doc-section-fix-flags Mathieu Desnoyers
2007-04-10 23:20 ` [PATCH] markers-i386-doc-section-flags-optimized-state-change Mathieu Desnoyers
2007-04-10 23:22 ` Mathieu Desnoyers [this message]
2007-04-10 23:24 ` [PATCH] markers-non-opt-arch-alpha-arm26-doc-flags Mathieu Desnoyers
2007-04-10 23:26 ` [PATCH] markers-doc-update-flags-example Mathieu Desnoyers
2007-04-11  2:37   ` Randy Dunlap
2007-04-11 18:57     ` [PATCH] Linux Kernel Markers documentation fix typo and use ARRAY_SIZE Mathieu Desnoyers
2007-04-10 23:27 ` [PATCH] build-avr32-marker-menu Mathieu Desnoyers
2007-04-10 23:29 ` [PATCH] markers-module.c-doc-flags Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070410232245.GE7092@Krystal \
    --to=compudj@krystal.dyndns.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox