public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Piazzalunga <danilopiazza@libero.it>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] hardcoded errno numbers in assembly code
Date: Fri, 23 Jan 2004 16:58:32 +0100	[thread overview]
Message-ID: <200401231658.33190.danilopiazza@libero.it> (raw)

Hello,

Some assembly code (on various archs) either 
 1. uses hardcoded errno numbers instead of the canonical macro names, or
 2. defines them locally, instead of including the appropriate header (while 
including other headers).

This patch "fixes" such usage in
 - getuser.S for arm, arm26 and i386
 - putuser.S for arm and arm26
 - entry.S for h8300 and sh

Version: 2.6.2-rc1, but applies cleanly to 2.6.1 and 2.6.0.

Cheers,
	Danilo


--- linux-2.6.2-rc1/arch/arm26/lib/getuser.S	2004-01-09 08:00:05.000000000 
+0100
+++ linux/arch/arm26/lib/getuser.S	2004-01-22 20:36:31.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <asm/asm_offsets.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
         .global __get_user_1
 __get_user_1:
@@ -98,7 +99,7 @@
         mov     r2, #0
 __get_user_bad:
         mov     r1, #0
-        mov     r0, #-14
+        mov     r0, #-EFAULT
         ldmfd   sp!, {pc}^
 
 .section __ex_table, "a"
--- linux-2.6.2-rc1/arch/arm26/lib/putuser.S	2004-01-09 07:59:44.000000000 
+0100
+++ linux/arch/arm26/lib/putuser.S	2004-01-22 20:35:56.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <asm/asm_offsets.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
         .global __put_user_1
 __put_user_1:
@@ -95,7 +96,7 @@
         ldmfd   sp!, {pc}^
 
 __put_user_bad:
-	mov	r0, #-14
+	mov	r0, #-EFAULT
 	mov	pc, lr
 
 .section __ex_table, "a"
--- linux-2.6.2-rc1/arch/arm/lib/getuser.S	2004-01-09 08:00:13.000000000 +0100
+++ linux/arch/arm/lib/getuser.S	2004-01-22 20:26:36.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <asm/constants.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
 	.global	__get_user_1
 __get_user_1:
@@ -89,7 +90,7 @@
 	mov	r2, #0
 __get_user_bad:
 	mov	r1, #0
-	mov	r0, #-14
+	mov	r0, #-EFAULT
 	mov	pc, lr
 
 .section __ex_table, "a"
--- linux-2.6.2-rc1/arch/arm/lib/putuser.S	2004-01-09 08:00:02.000000000 +0100
+++ linux/arch/arm/lib/putuser.S	2004-01-22 20:26:15.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <asm/constants.h>
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
 	.global	__put_user_1
 __put_user_1:
@@ -87,7 +88,7 @@
 	/* fall through */
 
 __put_user_bad:
-	mov	r0, #-14
+	mov	r0, #-EFAULT
 	mov	pc, lr
 
 .section __ex_table, "a"
--- linux-2.6.2-rc1/arch/h8300/platform/h8300h/entry.S	2004-01-09 
07:59:26.000000000 +0100
+++ linux/arch/h8300/platform/h8300h/entry.S	2004-01-22 20:50:36.000000000 
+0100
@@ -21,8 +21,7 @@
 #include <asm/linkage.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
-			
-ENOSYS = 38
+#include <asm/errno.h>
 
 LSIGTRAP = 5
 
--- linux-2.6.2-rc1/arch/h8300/platform/h8s/entry.S	2004-01-09 
07:59:56.000000000 +0100
+++ linux/arch/h8300/platform/h8s/entry.S	2004-01-22 20:51:24.000000000 +0100
@@ -22,8 +22,7 @@
 #include <asm/linkage.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
-
-ENOSYS = 38
+#include <asm/errno.h>
 
 LSIGTRAP = 5
 
--- linux-2.6.2-rc1/arch/i386/lib/getuser.S	2004-01-09 07:59:03.000000000 
+0100
+++ linux/arch/i386/lib/getuser.S	2004-01-22 19:53:23.000000000 +0100
@@ -9,6 +9,7 @@
  * return value.
  */
 #include <asm/thread_info.h>
+#include <asm/errno.h>
 
 
 /*
@@ -60,7 +61,7 @@
 
 bad_get_user:
 	xorl %edx,%edx
-	movl $-14,%eax
+	movl $-EFAULT,%eax
 	ret
 
 .section __ex_table,"a"
--- linux-2.6.2-rc1/arch/sh/kernel/entry.S	2004-01-23 01:59:03.000000000 +0100
+++ linux/arch/sh/kernel/entry.S	2004-01-23 02:30:58.000000000 +0100
@@ -16,6 +16,7 @@
 #include <linux/config.h>
 #include <asm/thread_info.h>
 #include <asm/unistd.h>
+#include <asm/errno.h>
 
 #if !defined(CONFIG_NFSD) && !defined(CONFIG_NFSD_MODULE)
 #define sys_nfsservctl		sys_ni_syscall
@@ -71,9 +72,6 @@
  *
  */
 
-ENOSYS = 38
-EINVAL = 22
-
 #if defined(CONFIG_CPU_SH3)
 TRA     = 0xffffffd0
 EXPEVT  = 0xffffffd4


                 reply	other threads:[~2004-01-23 15:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200401231658.33190.danilopiazza@libero.it \
    --to=danilopiazza@libero.it \
    --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