aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 13:33:00 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:33:00 +0100
commitd50efc6c40620b2e11648cac64ebf4a824e40382 (patch)
treedaf951117c86f2d4875216eee9e708a0c01c9e4b /include
parent3a556b26a2718e48aa2b6ce06ea4875ddcd0778e (diff)
downloadkernel_samsung_aries-d50efc6c40620b2e11648cac64ebf4a824e40382.zip
kernel_samsung_aries-d50efc6c40620b2e11648cac64ebf4a824e40382.tar.gz
kernel_samsung_aries-d50efc6c40620b2e11648cac64ebf4a824e40382.tar.bz2
x86: fix UML and -regparm=3
introduce the "asmregparm" calling convention: for functions implemented in assembly with a fixed regparm input parameters calling convention. mark the semaphore and rwsem slowpath functions with that. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/linkage.h5
-rw-r--r--include/asm-x86/rwsem.h12
-rw-r--r--include/asm-x86/semaphore_32.h8
-rw-r--r--include/linux/linkage.h4
4 files changed, 21 insertions, 8 deletions
diff --git a/include/asm-x86/linkage.h b/include/asm-x86/linkage.h
index 5a4c959..31739c7 100644
--- a/include/asm-x86/linkage.h
+++ b/include/asm-x86/linkage.h
@@ -9,6 +9,11 @@
#ifdef CONFIG_X86_32
#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
#define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
+/*
+ * For 32-bit UML - mark functions implemented in assembly that use
+ * regparm input parameters:
+ */
+#define asmregparm __attribute__((regparm(3)))
#endif
#ifdef CONFIG_X86_ALIGNMENT_16
diff --git a/include/asm-x86/rwsem.h b/include/asm-x86/rwsem.h
index a7e7e14..520a379 100644
--- a/include/asm-x86/rwsem.h
+++ b/include/asm-x86/rwsem.h
@@ -44,10 +44,14 @@
struct rwsem_waiter;
-extern struct rw_semaphore *FASTCALL(rwsem_down_read_failed(struct rw_semaphore *sem));
-extern struct rw_semaphore *FASTCALL(rwsem_down_write_failed(struct rw_semaphore *sem));
-extern struct rw_semaphore *FASTCALL(rwsem_wake(struct rw_semaphore *));
-extern struct rw_semaphore *FASTCALL(rwsem_downgrade_wake(struct rw_semaphore *sem));
+extern asmregparm struct rw_semaphore *
+ rwsem_down_read_failed(struct rw_semaphore *sem);
+extern asmregparm struct rw_semaphore *
+ rwsem_down_write_failed(struct rw_semaphore *sem);
+extern asmregparm struct rw_semaphore *
+ rwsem_wake(struct rw_semaphore *);
+extern asmregparm struct rw_semaphore *
+ rwsem_downgrade_wake(struct rw_semaphore *sem);
/*
* the semaphore definition
diff --git a/include/asm-x86/semaphore_32.h b/include/asm-x86/semaphore_32.h
index cc826e8..ac96d38 100644
--- a/include/asm-x86/semaphore_32.h
+++ b/include/asm-x86/semaphore_32.h
@@ -83,10 +83,10 @@ static inline void init_MUTEX_LOCKED (struct semaphore *sem)
sema_init(sem, 0);
}
-void __down_failed(void /* special register calling convention */);
-int __down_failed_interruptible(void /* params in registers */);
-int __down_failed_trylock(void /* params in registers */);
-void __up_wakeup(void /* special register calling convention */);
+extern asmregparm void __down_failed(atomic_t *count_ptr);
+extern asmregparm int __down_failed_interruptible(atomic_t *count_ptr);
+extern asmregparm int __down_failed_trylock(atomic_t *count_ptr);
+extern asmregparm void __up_wakeup(atomic_t *count_ptr);
/*
* This is ugly, but we want the default case to fall through.
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index ff203dd..ceeeb5e 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -13,6 +13,10 @@
#define asmlinkage CPP_ASMLINKAGE
#endif
+#ifndef asmregparm
+# define asmregparm
+#endif
+
#ifndef prevent_tail_call
# define prevent_tail_call(ret) do { } while (0)
#endif