aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2004-07-31 14:18:26 +0000
committerDavid Xu <davidxu@FreeBSD.org>2004-07-31 14:18:26 +0000
commitaa087e0e129c2337f187f71bf8a502bdce9f5464 (patch)
treee945cd05a1ab489b27dc253d292e85127280ddd4
parent5f0d8cc3275c6d03088354c36f8064ba52afc3ff (diff)
Notes
-rw-r--r--lib/libkse/arch/amd64/amd64/context.S7
-rw-r--r--lib/libpthread/arch/amd64/amd64/context.S7
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/libkse/arch/amd64/amd64/context.S b/lib/libkse/arch/amd64/amd64/context.S
index 25100213447e..9e6ed74df710 100644
--- a/lib/libkse/arch/amd64/amd64/context.S
+++ b/lib/libkse/arch/amd64/amd64/context.S
@@ -106,15 +106,17 @@ __FBSDID("$FreeBSD$");
#define MC_R15 (15 * 8)
#define MC_FLAGS (18 * 8)
#define MC_RIP (20 * 8)
+#define MC_CS (21 * 8)
#define MC_RFLAGS (22 * 8)
#define MC_RSP (23 * 8)
+#define MC_SS (24 * 8)
#define REDZONE 128 /* size of the red zone */
/*
* _amd64_ctx_save(mcontext_t *mcp)
*
- * No values are saved to mc_trapno, mc_addr, mc_err, mc_cs, or mc_ss.
+ * No values are saved to mc_trapno, mc_addr, mc_err and mc_cs.
* For the FPU state, only the floating point control word is stored.
*/
ENTRY(_amd64_save_context)
@@ -145,9 +147,10 @@ ENTRY(_amd64_save_context)
movq %rsp, %rax /* setcontext pushes the return */
addq $8, %rax /* address onto the stack; */
movq %rax, MC_RSP(%rdi) /* account for this -- ???. */
+ movw %ss, MC_SS(%rdi)
fnstcw MC_FP_CW_OFFSET(%rdi) /* save FPU control word */
movq $MC_OWNEDFP_NONE, MC_OWNEDFP_OFFSET(%rdi) /* no FP */
- /*movq $MC_FPFMT_NODEV, MC_FPFMT_OFFSET(%rdi)*/ /* unused for amd64 */
+ movq $MC_FPFMT_NODEV, MC_FPFMT_OFFSET(%rdi)
movq $MC_SIZE, MC_LEN_OFFSET(%rdi)
xorq %rax, %rax /* return 0 */
2: ret
diff --git a/lib/libpthread/arch/amd64/amd64/context.S b/lib/libpthread/arch/amd64/amd64/context.S
index 25100213447e..9e6ed74df710 100644
--- a/lib/libpthread/arch/amd64/amd64/context.S
+++ b/lib/libpthread/arch/amd64/amd64/context.S
@@ -106,15 +106,17 @@ __FBSDID("$FreeBSD$");
#define MC_R15 (15 * 8)
#define MC_FLAGS (18 * 8)
#define MC_RIP (20 * 8)
+#define MC_CS (21 * 8)
#define MC_RFLAGS (22 * 8)
#define MC_RSP (23 * 8)
+#define MC_SS (24 * 8)
#define REDZONE 128 /* size of the red zone */
/*
* _amd64_ctx_save(mcontext_t *mcp)
*
- * No values are saved to mc_trapno, mc_addr, mc_err, mc_cs, or mc_ss.
+ * No values are saved to mc_trapno, mc_addr, mc_err and mc_cs.
* For the FPU state, only the floating point control word is stored.
*/
ENTRY(_amd64_save_context)
@@ -145,9 +147,10 @@ ENTRY(_amd64_save_context)
movq %rsp, %rax /* setcontext pushes the return */
addq $8, %rax /* address onto the stack; */
movq %rax, MC_RSP(%rdi) /* account for this -- ???. */
+ movw %ss, MC_SS(%rdi)
fnstcw MC_FP_CW_OFFSET(%rdi) /* save FPU control word */
movq $MC_OWNEDFP_NONE, MC_OWNEDFP_OFFSET(%rdi) /* no FP */
- /*movq $MC_FPFMT_NODEV, MC_FPFMT_OFFSET(%rdi)*/ /* unused for amd64 */
+ movq $MC_FPFMT_NODEV, MC_FPFMT_OFFSET(%rdi)
movq $MC_SIZE, MC_LEN_OFFSET(%rdi)
xorq %rax, %rax /* return 0 */
2: ret