View | Details | Raw Unified | Return to bug 165622 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/src/sys/compat/ndis/pe_var.h (-6 / +14 lines)
Lines 460-481 Link Here
460
extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t,
460
extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t,
461
	uint64_t, uint64_t);
461
	uint64_t, uint64_t);
462
462
463
uint64_t _x86_64_call1(void *, uint64_t);
464
uint64_t _x86_64_call2(void *, uint64_t, uint64_t);
465
uint64_t _x86_64_call3(void *, uint64_t, uint64_t, uint64_t);
466
uint64_t _x86_64_call4(void *, uint64_t, uint64_t, uint64_t, uint64_t);
467
uint64_t _x86_64_call5(void *, uint64_t, uint64_t, uint64_t, uint64_t,
468
    uint64_t);
469
uint64_t _x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t,
470
    uint64_t, uint64_t);
463
471
464
#define	MSCALL1(fn, a)						\
472
#define	MSCALL1(fn, a)						\
465
	x86_64_call1((fn), (uint64_t)(a))
473
	_x86_64_call1((fn), (uint64_t)(a))
466
#define	MSCALL2(fn, a, b)					\
474
#define	MSCALL2(fn, a, b)					\
467
	x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b))
475
	_x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b))
468
#define	MSCALL3(fn, a, b, c)					\
476
#define	MSCALL3(fn, a, b, c)					\
469
	x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b),		\
477
	_x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b),		\
470
	(uint64_t)(c))
478
	(uint64_t)(c))
471
#define	MSCALL4(fn, a, b, c, d)					\
479
#define	MSCALL4(fn, a, b, c, d)					\
472
	x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b),		\
480
	_x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b),		\
473
	(uint64_t)(c), (uint64_t)(d))
481
	(uint64_t)(c), (uint64_t)(d))
474
#define	MSCALL5(fn, a, b, c, d, e)				\
482
#define	MSCALL5(fn, a, b, c, d, e)				\
475
	x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b),		\
483
	_x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b),		\
476
	(uint64_t)(c), (uint64_t)(d), (uint64_t)(e))
484
	(uint64_t)(c), (uint64_t)(d), (uint64_t)(e))
477
#define	MSCALL6(fn, a, b, c, d, e, f)				\
485
#define	MSCALL6(fn, a, b, c, d, e, f)				\
478
	x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b),		\
486
	_x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b),		\
479
	(uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f))
487
	(uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f))
480
488
481
#endif /* __amd64__ */
489
#endif /* __amd64__ */
(-)/usr/src/sys/compat/ndis/kern_windrv.c (+107 lines)
Lines 56-61 Link Here
56
#include <machine/segments.h>
56
#include <machine/segments.h>
57
#endif
57
#endif
58
58
59
#ifdef __amd64__
60
#include <machine/fpu.h>
61
#endif
62
59
#include <dev/usb/usb.h>
63
#include <dev/usb/usb.h>
60
64
61
#include <compat/ndis/pe_var.h>
65
#include <compat/ndis/pe_var.h>
Lines 573-578 Link Here
573
	return (0);
577
	return (0);
574
}
578
}
575
579
580
uint64_t
581
_x86_64_call1(void *fn, uint64_t a)
582
{
583
	struct fpu_kern_ctx *fpu_ctx_save;
584
	uint64_t ret;
585
586
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
587
	if (fpu_ctx_save == NULL)
588
		return (ENOMEM);
589
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
590
	ret = x86_64_call1(fn, a);
591
	fpu_kern_leave(curthread, fpu_ctx_save);
592
	fpu_kern_free_ctx(fpu_ctx_save);
593
594
	return (ret);
595
}
596
597
uint64_t
598
_x86_64_call2(void *fn, uint64_t a, uint64_t b)
599
{
600
	struct fpu_kern_ctx *fpu_ctx_save;
601
	uint64_t ret;
602
603
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
604
	if (fpu_ctx_save == NULL)
605
		return (ENOMEM);
606
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
607
	ret = x86_64_call2(fn, a, b);
608
	fpu_kern_leave(curthread, fpu_ctx_save);
609
	fpu_kern_free_ctx(fpu_ctx_save);
610
611
	return (ret);
612
}
613
614
uint64_t
615
_x86_64_call3(void *fn, uint64_t a, uint64_t b, uint64_t c)
616
{
617
	struct fpu_kern_ctx *fpu_ctx_save;
618
	uint64_t ret;
619
620
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
621
	if (fpu_ctx_save == NULL)
622
		return (ENOMEM);
623
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
624
	ret = x86_64_call3(fn, a, b, c);
625
	fpu_kern_leave(curthread, fpu_ctx_save);
626
	fpu_kern_free_ctx(fpu_ctx_save);
627
628
	return (ret);
629
}
630
631
uint64_t
632
_x86_64_call4(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d)
633
{
634
	struct fpu_kern_ctx *fpu_ctx_save;
635
	uint64_t ret;
636
637
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
638
	if (fpu_ctx_save == NULL)
639
		return (ENOMEM);
640
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
641
	ret = x86_64_call4(fn, a, b, c, d);
642
	fpu_kern_leave(curthread, fpu_ctx_save);
643
	fpu_kern_free_ctx(fpu_ctx_save);
644
645
	return (ret);
646
}
647
648
uint64_t
649
_x86_64_call5(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d,
650
    uint64_t e)
651
{
652
	struct fpu_kern_ctx *fpu_ctx_save;
653
	uint64_t ret;
654
655
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
656
	if (fpu_ctx_save == NULL)
657
		return (ENOMEM);
658
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
659
	ret = x86_64_call5(fn, a, b, c, d, e);
660
	fpu_kern_leave(curthread, fpu_ctx_save);
661
	fpu_kern_free_ctx(fpu_ctx_save);
662
663
	return (ret);
664
}
665
666
uint64_t
667
_x86_64_call6(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d,
668
    uint64_t e, uint64_t f)
669
{
670
	struct fpu_kern_ctx *fpu_ctx_save;
671
	uint64_t ret;
672
673
	fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | FPU_KERN_NOWAIT);
674
	if (fpu_ctx_save == NULL)
675
		return (ENOMEM);
676
	fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
677
	ret = x86_64_call6(fn, a, b, c, d, e, f);
678
	fpu_kern_leave(curthread, fpu_ctx_save);
679
	fpu_kern_free_ctx(fpu_ctx_save);
680
681
	return (ret);
682
}
576
#ifdef __amd64__
683
#ifdef __amd64__
577
684
578
extern void	x86_64_wrap(void);
685
extern void	x86_64_wrap(void);

Return to bug 165622