summaryrefslogtreecommitdiff
path: root/linux/src
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-05-02 20:53:54 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-05-02 20:55:38 +0200
commit7803e9735dde445be3046a79bf1b4ca5ab525ac1 (patch)
tree60919b06c39513846b09f6395474ee2e230e5608 /linux/src
parent32b3385c56912dac71e7f54fe03ff895cb4381c5 (diff)
Fix semaphore failure path special calling convention
* linux/src/include/asm-i386/semaphore.h (down): Pass semaphore address to down_failed through ecx. (down_interruptible): Likewise to down_failed_interruptible. (up): Likewise to up_wakeup.
Diffstat (limited to 'linux/src')
-rw-r--r--linux/src/include/asm-i386/semaphore.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/linux/src/include/asm-i386/semaphore.h b/linux/src/include/asm-i386/semaphore.h
index 2a5f5b7..c351c3a 100644
--- a/linux/src/include/asm-i386/semaphore.h
+++ b/linux/src/include/asm-i386/semaphore.h
@@ -30,6 +30,10 @@ struct semaphore {
#define MUTEX ((struct semaphore) { 1, 0, 0, NULL })
#define MUTEX_LOCKED ((struct semaphore) { 0, 0, 0, NULL })
+/* Special register calling convention:
+ * eax contains return address
+ * ecx contains semaphore address
+ */
asmlinkage void down_failed(void /* special register calling convention */);
asmlinkage void up_wakeup(void /* special register calling convention */);
@@ -54,7 +58,7 @@ extern inline void down(struct semaphore * sem)
"js " SYMBOL_NAME_STR(down_failed) "\n"
"1:\n"
:"=&a" (d0), "=m" (sem->count)
- :
+ :"c" (sem)
:"memory");
}
@@ -97,7 +101,7 @@ extern inline int down_interruptible(struct semaphore * sem)
"xorl %%eax,%%eax\n"
"2:\n"
:"=&a" (ret), "=m" (sem->count)
- :
+ :"c" (sem)
:"memory");
return(ret) ;
@@ -122,7 +126,7 @@ extern inline void up(struct semaphore * sem)
"jle " SYMBOL_NAME_STR(up_wakeup)
"\n1:"
:"=&a" (d0), "=m" (sem->count)
- :
+ :"c" (sem)
:"memory");
}