summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-12-07 02:23:16 +0000
committerjhb <jhb@FreeBSD.org>2000-12-07 02:23:16 +0000
commite024f021d440903a9d796cdff9bda7f58621f2c8 (patch)
treeabf91085bf16d11108d2621cb592aff832813cd9 /sys
parent73a1db8cb2873a986b2f622a7b3385fa87597dda (diff)
downloadFreeBSD-src-e024f021d440903a9d796cdff9bda7f58621f2c8.zip
FreeBSD-src-e024f021d440903a9d796cdff9bda7f58621f2c8.tar.gz
Fix broken register restraints that needlessly clobbered registers %ecx
and %edx resulting in gcc not having enough registers left to work with.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/mutex.h26
-rw-r--r--sys/i386/include/mutex.h26
2 files changed, 26 insertions, 26 deletions
diff --git a/sys/amd64/include/mutex.h b/sys/amd64/include/mutex.h
index 4b9fe2c8..ff08935 100644
--- a/sys/amd64/include/mutex.h
+++ b/sys/amd64/include/mutex.h
@@ -104,7 +104,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 3 (input) */ \
"gi" (type), /* 4 */ \
"g" (mtxp) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/* Get a spin lock, handle recursion inline (as the less common case) */
@@ -132,7 +132,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 3 (input) */ \
"gi" (type), /* 4 */ \
"g" (mtxp) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -158,7 +158,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 2 (input) */ \
"gi" (type), /* 3 */ \
"g" (mtxp) /* 4 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -183,7 +183,7 @@ extern char STR_SIEN[];
: "gi" (type), /* 2 (input) */ \
"g" (mtxp), /* 3 */ \
"r" (MTX_UNOWNED) /* 4 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -217,7 +217,7 @@ extern char STR_SIEN[];
: "gi" (type), /* 3 (input) */ \
"g" (mtxp), /* 4 */ \
"r" (MTX_UNOWNED) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -230,24 +230,24 @@ extern char STR_SIEN[];
int _res; \
\
__asm __volatile ( \
-" movl %1,%%eax;" \
-" decl %%eax;" \
+" movl %1,%2;" \
+" decl %2;" \
" js 1f;" \
-" movl %%eax,%1;" \
+" movl %2,%1;" \
" jmp 2f;" \
-"1: movl %0,%%eax;" \
-" movl $ " _V(MTX_UNOWNED) ",%%ecx;" \
+"1: movl %0,%2;" \
" pushl %3;" \
" " MPLOCKED "" \
-" cmpxchgl %%ecx,%0;" \
+" cmpxchgl %4,%0;" \
" popfl;" \
"2:" \
"# exitlock_spin" \
: "+m" (mtxp->mtx_lock), /* 0 */ \
"+m" (mtxp->mtx_recurse), /* 1 */ \
"=&a" (_res) /* 2 */ \
- : "g" (mtxp->mtx_saveintr) /* 3 */ \
- : "memory", "ecx" /* used */ ); \
+ : "g" (mtxp->mtx_saveintr), /* 3 */ \
+ "r" (MTX_UNOWNED) /* 4 */ \
+ : "memory" /* used */ ); \
})
#endif /* I386_CPU */
diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h
index 4b9fe2c8..ff08935 100644
--- a/sys/i386/include/mutex.h
+++ b/sys/i386/include/mutex.h
@@ -104,7 +104,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 3 (input) */ \
"gi" (type), /* 4 */ \
"g" (mtxp) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/* Get a spin lock, handle recursion inline (as the less common case) */
@@ -132,7 +132,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 3 (input) */ \
"gi" (type), /* 4 */ \
"g" (mtxp) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -158,7 +158,7 @@ extern char STR_SIEN[];
: "r" (tid), /* 2 (input) */ \
"gi" (type), /* 3 */ \
"g" (mtxp) /* 4 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -183,7 +183,7 @@ extern char STR_SIEN[];
: "gi" (type), /* 2 (input) */ \
"g" (mtxp), /* 3 */ \
"r" (MTX_UNOWNED) /* 4 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -217,7 +217,7 @@ extern char STR_SIEN[];
: "gi" (type), /* 3 (input) */ \
"g" (mtxp), /* 4 */ \
"r" (MTX_UNOWNED) /* 5 */ \
- : "memory", "ecx", "edx" /* used */ ); \
+ : "memory" /* used */ ); \
})
/*
@@ -230,24 +230,24 @@ extern char STR_SIEN[];
int _res; \
\
__asm __volatile ( \
-" movl %1,%%eax;" \
-" decl %%eax;" \
+" movl %1,%2;" \
+" decl %2;" \
" js 1f;" \
-" movl %%eax,%1;" \
+" movl %2,%1;" \
" jmp 2f;" \
-"1: movl %0,%%eax;" \
-" movl $ " _V(MTX_UNOWNED) ",%%ecx;" \
+"1: movl %0,%2;" \
" pushl %3;" \
" " MPLOCKED "" \
-" cmpxchgl %%ecx,%0;" \
+" cmpxchgl %4,%0;" \
" popfl;" \
"2:" \
"# exitlock_spin" \
: "+m" (mtxp->mtx_lock), /* 0 */ \
"+m" (mtxp->mtx_recurse), /* 1 */ \
"=&a" (_res) /* 2 */ \
- : "g" (mtxp->mtx_saveintr) /* 3 */ \
- : "memory", "ecx" /* used */ ); \
+ : "g" (mtxp->mtx_saveintr), /* 3 */ \
+ "r" (MTX_UNOWNED) /* 4 */ \
+ : "memory" /* used */ ); \
})
#endif /* I386_CPU */
OpenPOWER on IntegriCloud