FreeBSD Bugzilla – Attachment 122420 Details for
Bug 165622
[ndis][panic][patch] Unregistered use of FPU in kernel on amd64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.89 KB, created by
Vladyslav Movchan
on 2012-03-02 13:50:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Vladyslav Movchan
Created:
2012-03-02 13:50:09 UTC
Size:
4.89 KB
patch
obsolete
>Index: /usr/src/sys/compat/ndis/pe_var.h >=================================================================== >--- /usr/src/sys/compat/ndis/pe_var.h (revision 232379) >+++ /usr/src/sys/compat/ndis/pe_var.h (working copy) >@@ -460,22 +460,30 @@ > extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, > uint64_t, uint64_t); > >+uint64_t _x86_64_call1(void *, uint64_t); >+uint64_t _x86_64_call2(void *, uint64_t, uint64_t); >+uint64_t _x86_64_call3(void *, uint64_t, uint64_t, uint64_t); >+uint64_t _x86_64_call4(void *, uint64_t, uint64_t, uint64_t, uint64_t); >+uint64_t _x86_64_call5(void *, uint64_t, uint64_t, uint64_t, uint64_t, >+ uint64_t); >+uint64_t _x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, >+ uint64_t, uint64_t); > > #define MSCALL1(fn, a) \ >- x86_64_call1((fn), (uint64_t)(a)) >+ _x86_64_call1((fn), (uint64_t)(a)) > #define MSCALL2(fn, a, b) \ >- x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) >+ _x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) > #define MSCALL3(fn, a, b, c) \ >- x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ >+ _x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ > (uint64_t)(c)) > #define MSCALL4(fn, a, b, c, d) \ >- x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ >+ _x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ > (uint64_t)(c), (uint64_t)(d)) > #define MSCALL5(fn, a, b, c, d, e) \ >- x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ >+ _x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ > (uint64_t)(c), (uint64_t)(d), (uint64_t)(e)) > #define MSCALL6(fn, a, b, c, d, e, f) \ >- x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ >+ _x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ > (uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f)) > > #endif /* __amd64__ */ >Index: /usr/src/sys/compat/ndis/kern_windrv.c >=================================================================== >--- /usr/src/sys/compat/ndis/kern_windrv.c (revision 232379) >+++ /usr/src/sys/compat/ndis/kern_windrv.c (working copy) >@@ -56,6 +56,10 @@ > #include <machine/segments.h> > #endif > >+#ifdef __amd64__ >+#include <machine/fpu.h> >+#endif >+ > #include <dev/usb/usb.h> > > #include <compat/ndis/pe_var.h> >@@ -573,6 +577,109 @@ > return (0); > } > >+uint64_t >+_x86_64_call1(void *fn, uint64_t a) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call1(fn, a); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} >+ >+uint64_t >+_x86_64_call2(void *fn, uint64_t a, uint64_t b) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call2(fn, a, b); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} >+ >+uint64_t >+_x86_64_call3(void *fn, uint64_t a, uint64_t b, uint64_t c) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call3(fn, a, b, c); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} >+ >+uint64_t >+_x86_64_call4(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call4(fn, a, b, c, d); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} >+ >+uint64_t >+_x86_64_call5(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, >+ uint64_t e) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call5(fn, a, b, c, d, e); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} >+ >+uint64_t >+_x86_64_call6(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, >+ uint64_t e, uint64_t f) >+{ >+ struct fpu_kern_ctx *fpu_ctx_save; >+ uint64_t ret; >+ >+ fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT); >+ if (fpu_ctx_save == NULL) >+ return (ENOMEM); >+ fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL); >+ ret = x86_64_call6(fn, a, b, c, d, e, f); >+ fpu_kern_leave(curthread, fpu_ctx_save); >+ fpu_kern_free_ctx(fpu_ctx_save); >+ >+ return (ret); >+} > #ifdef __amd64__ > > extern void x86_64_wrap(void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 165622
: 122420 |
122421
|
122422
|
153770