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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1214602486-17080-21-git-send-email-gcosta@redhat.com>
Date:	Fri, 27 Jun 2008 18:34:27 -0300
From:	Glauber Costa <gcosta@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	tglx@...utronix.de, mingo@...e.hu, x86@...nel.org
Subject: [PATCH 20/39] replace function headers by macros

in putuser_64.S, do it the i386 way, and replace the code
in beginning and end of functions with macros, since it's
always the same thing. Save lines.

Signed-off-by: Glauber Costa <gcosta@...hat.com>
---
 arch/x86/lib/putuser_64.S |   32 ++++++++++++++------------------
 1 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/arch/x86/lib/putuser_64.S b/arch/x86/lib/putuser_64.S
index a96bd8a..6d7513b 100644
--- a/arch/x86/lib/putuser_64.S
+++ b/arch/x86/lib/putuser_64.S
@@ -31,62 +31,58 @@
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 
+#define ENTER   CFI_STARTPROC ; \
+                GET_THREAD_INFO(%rbx)
+#define EXIT    ret ; \
+                CFI_ENDPROC
+
 	.text
 ENTRY(__put_user_1)
-	CFI_STARTPROC
-	GET_THREAD_INFO(%rbx)
+	ENTER
 	cmpq TI_addr_limit(%rbx),%rcx
 	jae bad_put_user
 1:	movb %al,(%rcx)
 	xorl %eax,%eax
-	ret
-	CFI_ENDPROC
+	EXIT
 ENDPROC(__put_user_1)
 
 ENTRY(__put_user_2)
-	CFI_STARTPROC
-	GET_THREAD_INFO(%rbx)
+	ENTER
 	mov TI_addr_limit(%rbx),%rbx
 	sub  $1, %rbx
 	cmpq %rbx ,%rcx
 	jae  bad_put_user
 2:	movw %ax,(%rcx)
 	xorl %eax,%eax
-	ret
-	CFI_ENDPROC
+	EXIT
 ENDPROC(__put_user_2)
 
 ENTRY(__put_user_4)
-	CFI_STARTPROC
-	GET_THREAD_INFO(%rbx)
+	ENTER
 	mov TI_addr_limit(%rbx),%rbx
 	sub  $3, %rbx
 	cmp  %rbx, %rcx
 	jae bad_put_user
 3:	movl %eax,(%rcx)
 	xorl %eax,%eax
-	ret
-	CFI_ENDPROC
+	EXIT
 ENDPROC(__put_user_4)
 
 ENTRY(__put_user_8)
-	CFI_STARTPROC
-	GET_THREAD_INFO(%rbx)
+	ENTER
 	mov TI_addr_limit(%rbx),%rbx
 	sub  $7, %rbx
 	cmp  %rbx, %rcx
 	jae bad_put_user
 4:	movq %rax,(%rcx)
 	xorl %eax,%eax
-	ret
-	CFI_ENDPROC
+	EXIT
 ENDPROC(__put_user_8)
 
 bad_put_user:
 	CFI_STARTPROC
 	movq $(-EFAULT),%rax
-	ret
-	CFI_ENDPROC
+	EXIT
 END(bad_put_user)
 
 .section __ex_table,"a"
-- 
1.5.5.1

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