diff options
author | jsg <> | 2010-05-03 07:22:07 +0000 |
---|---|---|
committer | jsg <> | 2010-05-03 07:22:07 +0000 |
commit | b1b5a7584340428bda6bfe49bc881c3865cd10c9 (patch) | |
tree | cd5c93b3e09295d96274792b23e274f22c4dc530 | |
parent | 3374ab37b74a5cd7d198a17bc67f12c6b5bf2232 (diff) | |
download | openbsd-b1b5a7584340428bda6bfe49bc881c3865cd10c9.tar.gz openbsd-b1b5a7584340428bda6bfe49bc881c3865cd10c9.tar.bz2 openbsd-b1b5a7584340428bda6bfe49bc881c3865cd10c9.zip |
When running in pic mode we don't have enough general registers for all
the xcrypt inputs, hence the dance which is done to make this work.
The constraint for the key however was "mr" which is both from
memory and from a general register, it seems gcc3 went with the former
and gcc4 went with the later in the pic case, so change the
constraint for the key to just "m" which gives us more efficient
code that both gcc3 and gcc4 are happy with.
ok kettenis@
-rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 2 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 4af40cdfc3..de2ee1efea 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c | |||
@@ -623,7 +623,7 @@ viac3_xcrypt_cbc(int *cw, const void *src, void *dst, void *key, int rep, | |||
623 | * -pic mode uses that register; so instead we must dance a little. | 623 | * -pic mode uses that register; so instead we must dance a little. |
624 | */ | 624 | */ |
625 | __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : | 625 | __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : |
626 | : "mr" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) | 626 | : "m" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) |
627 | : "memory", "cc"); | 627 | : "memory", "cc"); |
628 | } | 628 | } |
629 | 629 | ||
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c index 4af40cdfc3..de2ee1efea 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c | |||
@@ -623,7 +623,7 @@ viac3_xcrypt_cbc(int *cw, const void *src, void *dst, void *key, int rep, | |||
623 | * -pic mode uses that register; so instead we must dance a little. | 623 | * -pic mode uses that register; so instead we must dance a little. |
624 | */ | 624 | */ |
625 | __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : | 625 | __asm __volatile("pushl %%ebx; movl %0, %%ebx; rep xcrypt-cbc; popl %%ebx" : |
626 | : "mr" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) | 626 | : "m" (key), "a" (iv), "c" (rep), "d" (cw), "S" (src), "D" (dst) |
627 | : "memory", "cc"); | 627 | : "memory", "cc"); |
628 | } | 628 | } |
629 | 629 | ||