VirtualBox

Ignore:
Timestamp:
Apr 6, 2015 11:34:45 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99402
Message:

asm-amd64-x86.h: Added ASMGetXcr0 & ASMSetXcr0.

Location:
trunk/src/VBox/Runtime/common/asm
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asm/ASMGetXcr0.asm

    r55084 r55107  
    11; $Id$
    22;; @file
    3 ; IPRT - ASMGetGDTR().
     3; IPRT - ASMGetXcr0().
    44;
    55
    66;
    7 ; Copyright (C) 2006-2013 Oracle Corporation
     7; Copyright (C) 2006-2015 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333
    3434;;
    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).
    3837;
    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?"
     38BEGINPROC_EXPORTED ASMGetXcr0
     39        xor     ecx, ecx                ; XCR0
     40        xgetbv
     41%ifdef RT_ARCH_AMD64
     42        shl     rdx, 32
     43        or      rax, rdx
    4844%endif
    49         sgdt    [xAX]
    5045        ret
    51 ENDPROC ASMGetGDTR
     46ENDPROC ASMGetXcr0
    5247
  • trunk/src/VBox/Runtime/common/asm/ASMSetXcr0.asm

    r55084 r55107  
    11; $Id$
    22;; @file
    3 ; IPRT - ASMSetGDTR().
     3; IPRT - ASMSetXcr0().
    44;
    55
    66;
    7 ; Copyright (C) 2006-2014 Oracle Corporation
     7; Copyright (C) 2006-2015 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333
    3434;;
    35 ; Sets the content of the GDTR CPU 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.
    3737;                   msc=rcx, gcc=rdi, x86=[esp+4]
    3838;
    39 BEGINPROC_EXPORTED ASMSetGDTR
     39BEGINPROC_EXPORTED ASMSetXcr0
    4040%ifdef ASM_CALL64_MSC
    41         mov     rax, rcx
     41        mov     rdx, rcx
     42        shr     rdx, 32
     43        mov     eax, ecx
    4244%elifdef ASM_CALL64_GCC
    43         mov     rax, rdi
     45        mov     rdx, rdi
     46        shr     rdx, 32
     47        mov     eax, edi
    4448%elifdef RT_ARCH_X86
    4549        mov     eax, [esp + 4]
     50        mov     edx, [esp + 8]
    4651%else
    4752 %error "Undefined arch?"
    4853%endif
    49         lgdt    [xAX]
     54        xor     ecx, ecx
     55        xsetbv
    5056        ret
    51 ENDPROC ASMSetGDTR
     57ENDPROC ASMSetXcr0
    5258
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette