chiark / gitweb /
[PATCH] fix asmlinkage
authormbuesch@freenet.de <mbuesch@freenet.de>
Thu, 14 Oct 2004 05:38:15 +0000 (22:38 -0700)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:55:39 +0000 (21:55 -0700)
This patch fixes the reintroduced bug with the
sig_handler(), if we link against a -mregparm=3 compiled
klibc on i386.
It also fixes some compiler warnings about redefined
asmlinkage on some systems.
Also some (broken?) compilers on distros throw out warnings
if asmlinkage is before "static void". This fixes it, too.

Makefile
udev.c
udev_lib.h
udevd.c

index 4107b96a3ff4e2ff582f45fa4e2a502b75bce8e7..4b8df13985c3277927312018d4518c4b28c1d72a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@ OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>
 # add -Wredundant-decls when libsysfs gets cleaned up
 WARNINGS := -Wall 
 
-CFLAGS := -pipe -Dasmlinkage=
+CFLAGS := -pipe
 
 # set up the proper tdb spinlock code if we can
 ifeq ($(strip $(ARCH)),i386)
diff --git a/udev.c b/udev.c
index 78da715fec2b5459bab639a7c7b42d64befb3b8c..94888d6a43a008f4fcfa4a4b49f0988acf0e1894 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -58,7 +58,7 @@ void log_message(int level, const char *format, ...)
 }
 #endif
 
-asmlinkage static void sig_handler(int signum)
+static void asmlinkage sig_handler(int signum)
 {
        switch (signum) {
                case SIGALRM:
index 2f1965ea32ac4f5743879f09260544d238634c0a..e9ff379fc6665fda1a5e70f2d60808882f09f458 100644 (file)
@@ -65,6 +65,15 @@ do { \
            pos = pos + len + strspn(pos, separator), len = strcspn(pos, separator)) \
                if (len > 0)
 
+#ifdef asmlinkage
+# undef asmlinkage
+#endif
+#ifdef __i386__
+# define asmlinkage    __attribute__((regparm(0)))
+#endif
+#ifndef asmlinkage
+# define asmlinkage    /* nothing */
+#endif
 
 extern char *get_action(void);
 extern char *get_devpath(void);
diff --git a/udevd.c b/udevd.c
index 380511d47eb24380d12812a141fe1cf2fc4c5345..811f62243eb98473d6691624dadcb2dfe67b235e 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -309,7 +309,7 @@ skip:
        return;
 }
 
-asmlinkage static void sig_handler(int signum)
+static void asmlinkage sig_handler(int signum)
 {
        int rc;