mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "S. P. Prasanna" <prasanna@in.ibm.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Jan Beulich <jbeulich@novell.com>,
	jeremy@goop.org, Andi Kleen <ak@muc.de>,
	ananth@in.ibm.com, anil.s.keshavamurthy@intel.com
Subject: Kprobes - i386 add KPROBE_END macro for .popsection
Date: Wed, 16 Aug 2006 19:19:32 +0530	[thread overview]
Message-ID: <20060816134932.GA28965@in.ibm.com> (raw)

This patch add a macro KPROBE_END() to add .popsection after each
KPROBE_ENTRY() usage, as suggested by Jan Beulich. This patch also
replace .popsection with the KPROBE_END() macro.
This will be helpful for the conversions like the recent
 .section -> .pushsection and .previous -> .popsection to be
confined to the header defining these macros, without need to touch
any assembly files.

Signed-off-by: Prasanna S. P. <prasanna@in.ibm.com>


 arch/i386/kernel/entry.S |   10 +++++-----
 include/linux/linkage.h  |    4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff -puN arch/i386/kernel/entry.S~kprobes-add-popsection-macro-for-assembly-stub arch/i386/kernel/entry.S
--- linux-2.6.18-rc4-mm1/arch/i386/kernel/entry.S~kprobes-add-popsection-macro-for-assembly-stub	2006-08-16 18:27:54.000000000 +0530
+++ linux-2.6.18-rc4-mm1-prasanna/arch/i386/kernel/entry.S	2006-08-16 18:32:53.000000000 +0530
@@ -646,7 +646,7 @@ error_code:
 	call *%edi
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(page_fault)
 
 ENTRY(coprocessor_error)
 	RING0_INT_FRAME
@@ -722,7 +722,7 @@ debug_stack_correct:
 	call do_debug
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(debug)
 
 /*
  * NMI is doubly nasty. It can happen _while_ we're handling
@@ -807,7 +807,7 @@ nmi_16bit_stack:
 .section __ex_table,"a"
 	.align 4
 	.long 1b,iret_exc
-.previous
+KPROBE_END(nmi)
 
 KPROBE_ENTRY(int3)
 	RING0_INT_FRAME
@@ -819,7 +819,7 @@ KPROBE_ENTRY(int3)
 	call do_int3
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(int3)
 
 ENTRY(overflow)
 	RING0_INT_FRAME
@@ -884,7 +884,7 @@ KPROBE_ENTRY(general_protection)
 	CFI_ADJUST_CFA_OFFSET 4
 	jmp error_code
 	CFI_ENDPROC
-.popsection
+KPROBE_END(general_protection)
 
 ENTRY(alignment_check)
 	RING0_EC_FRAME
diff -puN include/linux/linkage.h~kprobes-add-popsection-macro-for-assembly-stub include/linux/linkage.h
--- linux-2.6.18-rc4-mm1/include/linux/linkage.h~kprobes-add-popsection-macro-for-assembly-stub	2006-08-16 18:28:11.000000000 +0530
+++ linux-2.6.18-rc4-mm1-prasanna/include/linux/linkage.h	2006-08-16 18:31:05.000000000 +0530
@@ -43,6 +43,10 @@
   .size name, .-name
 #endif
 
+#define KPROBE_END(name) \
+   END(name); \
+  .popsection
+
 #ifndef ENDPROC
 #define ENDPROC(name) \
   .type name, @function; \

_
-- 
Prasanna S.P.
Linux Technology Center
India Software Labs, IBM Bangalore
Email: prasanna@in.ibm.com
Ph: 91-80-41776329

             reply	other threads:[~2006-08-16 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-16 13:49 S. P. Prasanna [this message]
2006-08-16 14:48 ` Andi Kleen

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=20060816134932.GA28965@in.ibm.com \
    --to=prasanna@in.ibm.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=jbeulich@novell.com \
    --cc=jeremy@goop.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

Powered by JetHome