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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081217111213.GA8342@mailshack.com>
Date:	Wed, 17 Dec 2008 12:12:14 +0100
From:	Alexander van Heukelum <heukelum@...lshack.com>
To:	David Howells <dhowells@...hat.com>
Cc:	Alexander van Heukelum <heukelum@...tmail.fm>,
	linux-arch@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Sam Ravnborg <sam@...nborg.org>,
	Cyrill Gorcunov <gorcunov@...il.com>
Subject: Re: PROC macro to annotate functions in assembly files

On Wed, Dec 17, 2008 at 10:53:53AM +0000, David Howells wrote:
> Alexander van Heukelum <heukelum@...tmail.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)

--
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