All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander van Heukelum <heukelum@mailshack.com>
To: David Howells <dhowells@redhat.com>
Cc: Alexander van Heukelum <heukelum@fastmail.fm>,
	linux-arch@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Cyrill Gorcunov <gorcunov@gmail.com>
Subject: Re: PROC macro to annotate functions in assembly files
Date: Wed, 17 Dec 2008 12:12:14 +0100	[thread overview]
Message-ID: <20081217111213.GA8342@mailshack.com> (raw)
In-Reply-To: <1636.1229511233@redhat.com>

On Wed, Dec 17, 2008 at 10:53:53AM +0000, David Howells wrote:
> Alexander van Heukelum <heukelum@fastmail.fm> wrote:
> 
> > The goal is to annotate functions, at least those called
> > from C code, with PROC at the beginning and ENDPROC at the
> > end. This is for the benefit of debugging and tracing.
> 
> What about asm functions that have multiple entry points?
> 
> Take arch/mn10300/mm/cache-flush-mn10300.S for example.  Several functions in
> there share bodies by virtue of falling through one to another.
> 
> David

Yeah, assembly files contain some interesting nesting. In this
particular case I think the solution is simple... Just use PROC
and ENDPROC around the complete functions, and leave the explicit
.global's for the additional entry points.

Have a look at arch/x86/crypto/aes-x86_64-asm_64.S too if you wish ;).

Greetings,
	Alexander

 arch/mn10300/mm/cache-flush-mn10300.S |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/mn10300/mm/cache-flush-mn10300.S b/arch/mn10300/mm/cache-flush-mn10300.S
index c8ed1cb..2c0f26d 100644
--- a/arch/mn10300/mm/cache-flush-mn10300.S
+++ b/arch/mn10300/mm/cache-flush-mn10300.S
@@ -16,12 +16,9 @@
 #include <asm/cache.h>
 
 	.am33_2
-	.globl mn10300_dcache_flush
-	.globl mn10300_dcache_flush_page
+	/* nested entry points */
 	.globl mn10300_dcache_flush_range
 	.globl mn10300_dcache_flush_range2
-	.globl mn10300_dcache_flush_inv
-	.globl mn10300_dcache_flush_inv_page
 	.globl mn10300_dcache_flush_inv_range
 	.globl mn10300_dcache_flush_inv_range2
 
@@ -31,8 +28,8 @@
 # Flush the entire data cache back to RAM
 #
 ###############################################################################
-	ALIGN
-mn10300_dcache_flush:
+
+PROC(mn10300_dcache_flush)
 	movhu	(CHCTR),d0
 	btst	CHCTR_DCEN,d0
 	beq	mn10300_dcache_flush_end
@@ -59,6 +56,7 @@ mn10300_dcache_flush_skip:
 
 mn10300_dcache_flush_end:
 	ret	[],0
+ENDPROC(mn10300_dcache_flush)
 
 ###############################################################################
 #
@@ -68,8 +66,8 @@ mn10300_dcache_flush_end:
 # Flush a range of addresses on a page in the dcache
 #
 ###############################################################################
-	ALIGN
-mn10300_dcache_flush_page:
+
+PROC(mn10300_dcache_flush_page)
 	mov	PAGE_SIZE,d1
 mn10300_dcache_flush_range2:
 	add	d0,d1
@@ -113,6 +111,7 @@ mn10300_dcache_flush_range_loop:
 
 mn10300_dcache_flush_range_end:
 	ret	[d2,d3],8
+ENDPROC(mn10300_dcache_flush_page)
 
 ###############################################################################
 #
@@ -120,8 +119,8 @@ mn10300_dcache_flush_range_end:
 # Flush the entire data cache and invalidate all entries
 #
 ###############################################################################
-	ALIGN
-mn10300_dcache_flush_inv:
+
+PROC(mn10300_dcache_flush_inv)
 	movhu	(CHCTR),d0
 	btst	CHCTR_DCEN,d0
 	beq	mn10300_dcache_flush_inv_end
@@ -139,6 +138,7 @@ mn10300_dcache_flush_inv_loop:
 
 mn10300_dcache_flush_inv_end:
 	ret	[],0
+ENDPROC(mn10300_dcache_flush_inv)
 
 ###############################################################################
 #
@@ -148,8 +148,8 @@ mn10300_dcache_flush_inv_end:
 # Flush and invalidate a range of addresses on a page in the dcache
 #
 ###############################################################################
-	ALIGN
-mn10300_dcache_flush_inv_page:
+
+PROC(mn10300_dcache_flush_inv_page)
 	mov	PAGE_SIZE,d1
 mn10300_dcache_flush_inv_range2:
 	add	d0,d1
@@ -190,3 +190,4 @@ mn10300_dcache_flush_inv_range_loop:
 
 mn10300_dcache_flush_inv_range_end:
 	ret	[d2,d3],8
+ENDPROC(mn10300_dcache_flush_inv_page)

  reply	other threads:[~2008-12-17 11:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17  9:17 PROC macro to annotate functions in assembly files Alexander van Heukelum
2008-12-17  9:17 ` [PATCH 1/many] " Alexander van Heukelum
2008-12-17  9:17   ` [PATCH last/many] x86: checking framework for correct use of ENTRY/PROC Alexander van Heukelum
2008-12-17 11:51     ` Cyrill Gorcunov
2008-12-17 12:04       ` Alexander van Heukelum
2008-12-17 14:43         ` Cyrill Gorcunov
2008-12-17 17:26   ` [PATCH 1/many] PROC macro to annotate functions in assembly files Sam Ravnborg
2008-12-17 17:38     ` Cyrill Gorcunov
2008-12-17 18:00       ` Sam Ravnborg
2008-12-17 18:33         ` Cyrill Gorcunov
2008-12-18  9:51         ` Alexander van Heukelum
2008-12-18 10:07           ` Russell King
2008-12-18 11:30             ` Alexander van Heukelum
2008-12-18 10:20           ` Jan Beulich
2008-12-18 10:20             ` Jan Beulich
2008-12-18 12:03           ` Cyrill Gorcunov
2008-12-18 12:40             ` Alexander van Heukelum
2008-12-18 16:05               ` Cyrill Gorcunov
2008-12-18  9:23     ` Alexander van Heukelum
2008-12-18 12:52     ` Ingo Molnar
2008-12-17 10:53 ` David Howells
2008-12-17 11:12   ` Alexander van Heukelum [this message]
2008-12-18 11:44     ` Russell King
2008-12-18 12:35       ` Alexander van Heukelum
2008-12-18 15:53         ` Russell King

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=20081217111213.GA8342@mailshack.com \
    --to=heukelum@mailshack.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=gorcunov@gmail.com \
    --cc=heukelum@fastmail.fm \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sam@ravnborg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.