7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; $Id$
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;; @file
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; IPRT - ASMGetXcr0().
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; Copyright (C) 2006-2015 Oracle Corporation
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; available from http://www.virtualbox.org. This file is free software;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; you can redistribute it and/or modify it under the terms of the GNU
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; General Public License (GPL) as published by the Free Software
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; The contents of this file may alternatively be used under the terms
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; of the Common Development and Distribution License Version 1.0
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; VirtualBox OSE distribution, in which case the provisions of the
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; CDDL are applicable instead of those of the GPL.
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; You may elect to license modified versions of this file under the
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; terms and conditions of either the GPL or the CDDL or both.
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;*******************************************************************************
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;* Header Files *
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;*******************************************************************************
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%define RT_ASM_WITH_SEH64
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync%include "iprt/asmdefs.mac"
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync
7a33455519f76382026197f01d5cac3f6a98ed51vboxsyncBEGINCODE
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; Gets the content of the XCR0 CPU register.
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync; @returns XCR0 value in rax (amd64) / edx:eax (x86).
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync;
7a33455519f76382026197f01d5cac3f6a98ed51vboxsyncBEGINPROC_EXPORTED ASMGetXcr0
d16f75bad381547b34a1f315da059b782f4c21d3vboxsyncSEH64_END_PROLOGUE
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync xor ecx, ecx ; XCR0
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync xgetbv
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync%ifdef RT_ARCH_AMD64
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync shl rdx, 32
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync or rax, rdx
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync%endif
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync ret
7a33455519f76382026197f01d5cac3f6a98ed51vboxsyncENDPROC ASMGetXcr0
7a33455519f76382026197f01d5cac3f6a98ed51vboxsync