summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/npx.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-06-29 12:06:36 +0000
committerkib <kib@FreeBSD.org>2015-06-29 12:06:36 +0000
commit623bffc36388de5d5ea6e20d990ba183e36ceb47 (patch)
treee9b0f95911a064282e73cae6af237abbda404d74 /sys/i386/include/npx.h
parent67042ee4424a0596a3848a68d5576b81daf0b21c (diff)
downloadFreeBSD-src-623bffc36388de5d5ea6e20d990ba183e36ceb47.zip
FreeBSD-src-623bffc36388de5d5ea6e20d990ba183e36ceb47.tar.gz
Provide npx_get_fsave(9) and npx_set_fsave(9) functions to obtain and
restore the FPU state from the format of machine FSAVE area. The intended use is for ABI emulators to provide FSAVE-formatted FPU state to usermode requiring it, while kernel could use FXSAVE due to XMM/XSAVE. The core functionality to convert from/to FXSAVE format is shared with the fill_fpregs_xmm() and set_fpregs_xmm(). Move the later functions to npx.c and rename them to npx_fill_fpregs_xmm() and npx_set_fpregs_xmm(). They differ from nptx_get/set_fsave(9) since our mcontext contains padding to be zeroed or ignored. fill_fpregs() and set_fpregs() could be converted to use the new interface, but there are small differences to handle. Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/i386/include/npx.h')
-rw-r--r--sys/i386/include/npx.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h
index 66f432a..0557228 100644
--- a/sys/i386/include/npx.h
+++ b/sys/i386/include/npx.h
@@ -67,6 +67,11 @@ void npxsuspend(union savefpu *addr);
int npxtrap_x87(void);
int npxtrap_sse(void);
void npxuserinited(struct thread *);
+void npx_get_fsave(void *);
+int npx_set_fsave(void *);
+void npx_fill_fpregs_xmm(struct savexmm *, struct save87 *);
+void npx_set_fpregs_xmm(struct save87 *, struct savexmm *);
+
struct fpu_kern_ctx *fpu_kern_alloc_ctx(u_int flags);
void fpu_kern_free_ctx(struct fpu_kern_ctx *ctx);
int fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx,
OpenPOWER on IntegriCloud