summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-12-05 01:41:43 +0000
committerpeter <peter@FreeBSD.org>2003-12-05 01:41:43 +0000
commitbf613741f01c73f17cf1e1fbca8cd612fe25dcbc (patch)
treec6258473b65f48d97899f192da96478567280c89
parentb339dae7c21edaa29991d8155aea2eae2979820c (diff)
downloadFreeBSD-src-bf613741f01c73f17cf1e1fbca8cd612fe25dcbc.zip
FreeBSD-src-bf613741f01c73f17cf1e1fbca8cd612fe25dcbc.tar.gz
Apply a second fix for stack alignment with libkse. This time, enter the
UTS with the stack correctly aligned. Also, while here, use an indirect jump rather than the pushq/ret hack. This fixes threaded apps that use floating point for me, although it hasn't solved all the problems. It is an improvement though. Preservation of the 128 byte red zone hasn't been resolved yet. Approved by: re (scottl)
-rw-r--r--lib/libkse/arch/amd64/amd64/enter_uts.S4
-rw-r--r--lib/libpthread/arch/amd64/amd64/enter_uts.S4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libkse/arch/amd64/amd64/enter_uts.S b/lib/libkse/arch/amd64/amd64/enter_uts.S
index c263eab..7f9a88d 100644
--- a/lib/libkse/arch/amd64/amd64/enter_uts.S
+++ b/lib/libkse/arch/amd64/amd64/enter_uts.S
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
ENTRY(_amd64_enter_uts)
addq %rcx, %rdx /* get stack base */
andq $~0xf, %rdx /* align to 16 bytes */
+ subq $8, %rdx /* simulate "call" alignment */
movq %rdx, %rsp /* switch to UTS stack */
movq %rdx, %rbp /* set frame */
- pushq %rsi
- ret
+ jmpq *%rsi
diff --git a/lib/libpthread/arch/amd64/amd64/enter_uts.S b/lib/libpthread/arch/amd64/amd64/enter_uts.S
index c263eab..7f9a88d 100644
--- a/lib/libpthread/arch/amd64/amd64/enter_uts.S
+++ b/lib/libpthread/arch/amd64/amd64/enter_uts.S
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
ENTRY(_amd64_enter_uts)
addq %rcx, %rdx /* get stack base */
andq $~0xf, %rdx /* align to 16 bytes */
+ subq $8, %rdx /* simulate "call" alignment */
movq %rdx, %rsp /* switch to UTS stack */
movq %rdx, %rbp /* set frame */
- pushq %rsi
- ret
+ jmpq *%rsi
OpenPOWER on IntegriCloud