Skip to contentSkip to conversation

hardcoded errno numbers in assembly code

PATCH New Danilo Piazzalunga 1 participant 1 message Jan 23, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hardcoded errno numbers in assembly code

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"

arch/arm/lib/getuser.S +2 -1
@@ -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"
arch/arm/lib/putuser.S +2 -1
@@ -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"

arch/sh/kernel/entry.S +1 -3
@@ -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