Changeset 55107 in vbox
- Timestamp:
- Apr 6, 2015 11:34:45 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 2 copied
-
include/iprt/asm-amd64-x86.h (modified) (1 diff)
-
src/VBox/Runtime/Makefile.kmk (modified) (4 diffs)
-
src/VBox/Runtime/common/asm/ASMGetXcr0.asm (copied) (copied from trunk/src/VBox/Runtime/common/asm/ASMGetGDTR.asm ) (2 diffs)
-
src/VBox/Runtime/common/asm/ASMSetXcr0.asm (copied) (copied from trunk/src/VBox/Runtime/common/asm/ASMSetGDTR.asm ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm-amd64-x86.h
r54260 r55107 1727 1727 1728 1728 /** 1729 * Get XCR0 (eXtended feature Control Register 0). 1730 * @returns xcr0. 1731 */ 1732 DECLASM(uint64_t) ASMGetXcr0(void); 1733 1734 1735 /** 1736 * Sets the XCR0 register. 1737 * @param uXcr0 The new XCR0 value. 1738 */ 1739 DECLASM(void) ASMSetXcr0(uint64_t uXcr0); 1740 1741 1742 /** 1729 1743 * Enables interrupts (EFLAGS.IF). 1730 1744 */ -
trunk/src/VBox/Runtime/Makefile.kmk
r55095 r55107 655 655 common/asm/ASMRdMsrEx.asm \ 656 656 common/asm/ASMWrMsrEx.asm \ 657 common/asm/ASMGetXcr0.asm \ 658 common/asm/ASMSetXcr0.asm \ 657 659 common/math/bignum-amd64-x86.asm 658 660 RuntimeR3_SOURCES.amd64 += \ … … 666 668 common/asm/ASMRdMsrEx.asm \ 667 669 common/asm/ASMWrMsrEx.asm \ 670 common/asm/ASMGetXcr0.asm \ 671 common/asm/ASMSetXcr0.asm \ 668 672 common/math/bignum-amd64-x86.asm \ 669 673 common/math/RTUInt128MulByU64.asm … … 1694 1698 common/asm/ASMAtomicUoOrU64.asm \ 1695 1699 common/asm/ASMAtomicUoOrU32.asm \ 1700 common/asm/ASMGetXcr0.asm \ 1701 common/asm/ASMSetXcr0.asm \ 1696 1702 common/asm/ASMRdMsrEx.asm \ 1697 1703 common/asm/ASMWrMsrEx.asm … … 1704 1710 common/asm/ASMAtomicUoOrU64.asm \ 1705 1711 common/asm/ASMAtomicUoOrU32.asm \ 1712 common/asm/ASMGetXcr0.asm \ 1713 common/asm/ASMSetXcr0.asm \ 1706 1714 common/asm/ASMRdMsrEx.asm \ 1707 1715 common/asm/ASMWrMsrEx.asm -
trunk/src/VBox/Runtime/common/asm/ASMGetXcr0.asm
r55084 r55107 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - ASMGet GDTR().3 ; IPRT - ASMGetXcr0(). 4 4 ; 5 5 6 6 ; 7 ; Copyright (C) 2006-201 3Oracle Corporation7 ; Copyright (C) 2006-2015 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 33 33 34 34 ;; 35 ; Gets the content of the GDTR CPU register. 36 ; @param pGdtr Where to store the GDTR contents. 37 ; msc=rcx, gcc=rdi, x86=[esp+4] 35 ; Gets the content of the XCR0 CPU register. 36 ; @returns XCR0 value in rax (amd64) / edx:eax (x86). 38 37 ; 39 BEGINPROC_EXPORTED ASMGetGDTR 40 %ifdef ASM_CALL64_MSC 41 mov rax, rcx 42 %elifdef ASM_CALL64_GCC 43 mov rax, rdi 44 %elifdef RT_ARCH_X86 45 mov eax, [esp + 4] 46 %else 47 %error "Undefined arch?" 38 BEGINPROC_EXPORTED ASMGetXcr0 39 xor ecx, ecx ; XCR0 40 xgetbv 41 %ifdef RT_ARCH_AMD64 42 shl rdx, 32 43 or rax, rdx 48 44 %endif 49 sgdt [xAX]50 45 ret 51 ENDPROC ASMGet GDTR46 ENDPROC ASMGetXcr0 52 47 -
trunk/src/VBox/Runtime/common/asm/ASMSetXcr0.asm
r55084 r55107 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - ASMSet GDTR().3 ; IPRT - ASMSetXcr0(). 4 4 ; 5 5 6 6 ; 7 ; Copyright (C) 2006-201 4Oracle Corporation7 ; Copyright (C) 2006-2015 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 33 33 34 34 ;; 35 ; Sets the content of the GDTRCPU register.36 ; @param pGdtr Where to load the GDTR contents from.35 ; Sets the content of the Xcr0 CPU register. 36 ; @param uXcr0 The new XCR0 content. 37 37 ; msc=rcx, gcc=rdi, x86=[esp+4] 38 38 ; 39 BEGINPROC_EXPORTED ASMSet GDTR39 BEGINPROC_EXPORTED ASMSetXcr0 40 40 %ifdef ASM_CALL64_MSC 41 mov rax, rcx 41 mov rdx, rcx 42 shr rdx, 32 43 mov eax, ecx 42 44 %elifdef ASM_CALL64_GCC 43 mov rax, rdi 45 mov rdx, rdi 46 shr rdx, 32 47 mov eax, edi 44 48 %elifdef RT_ARCH_X86 45 49 mov eax, [esp + 4] 50 mov edx, [esp + 8] 46 51 %else 47 52 %error "Undefined arch?" 48 53 %endif 49 lgdt [xAX] 54 xor ecx, ecx 55 xsetbv 50 56 ret 51 ENDPROC ASMSet GDTR57 ENDPROC ASMSetXcr0 52 58
Note:
See TracChangeset
for help on using the changeset viewer.

