aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/ucontext.h
diff options
context:
space:
mode:
authorJonathan Mini <mini@FreeBSD.org>2002-09-16 19:25:41 +0000
committerJonathan Mini <mini@FreeBSD.org>2002-09-16 19:25:41 +0000
commit9ba15479299f7ead3ea98f04cf0ff46c48160f49 (patch)
treef68cce90cf752f653302c6c5c0876070f6fff7ab /sys/amd64/include/ucontext.h
parent575525a0005f266a0dee465d9df7127bfeef2c24 (diff)
downloadsrc-9ba15479299f7ead3ea98f04cf0ff46c48160f49.tar.gz
src-9ba15479299f7ead3ea98f04cf0ff46c48160f49.zip
Add kernel support needed for the KSE-aware libpthread:
- Maintain fpu state across signals. - Save and restore FPU state properly in ucontext_t's. Reviewed by: deischen, julian Approved by: -arch
Notes
Notes: svn path=/head/; revision=103408
Diffstat (limited to 'sys/amd64/include/ucontext.h')
-rw-r--r--sys/amd64/include/ucontext.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/amd64/include/ucontext.h b/sys/amd64/include/ucontext.h
index a84a2cb3fe3b..1739818a1049 100644
--- a/sys/amd64/include/ucontext.h
+++ b/sys/amd64/include/ucontext.h
@@ -58,11 +58,25 @@ typedef struct __mcontext {
int mc_esp; /* machine state */
int mc_ss;
- int mc_fpregs[28]; /* env87 + fpacc87 + u_long */
-#define __UC_MC_VALID 0x0001 /* mcontext register state is valid */
-#define __UC_FP_VALID 0x0002 /* FP registers have been saved */
- int mc_flags;
- int __spare__[16];
+ int mc_len; /* sizeof(mcontext_t) */
+#define _MC_FPFMT_NODEV 0 /* device not present or configured */
+#define _MC_FPFMT_387 1
+#define _MC_FPFMT_XMM 2
+ int mc_fpformat;
+#define _MC_FPOWNED_NONE 0 /* FP state not used */
+#define _MC_FPOWNED_FPU 1 /* FP state came from FPU */
+#define _MC_FPOWNED_PCB 2 /* FP state came from PCB */
+ int mc_ownedfp;
+ int mc_spare1[1]; /* align next field to 16 bytes */
+ int mc_fpstate[128]; /* must be multiple of 16 bytes */
+ int mc_spare2[8];
} mcontext_t;
+#ifdef _KERNEL
+struct thread;
+
+void get_mcontext(struct thread *td, mcontext_t *mcp);
+int set_mcontext(struct thread *td, const mcontext_t *mcp);
+#endif
+
#endif /* !_MACHINE_UCONTEXT_H_ */