d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; $Id$
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;; @file
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; IPRT - ASMXSave().
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; Copyright (C) 2006-2015 Oracle Corporation
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; available from http://www.virtualbox.org. This file is free software;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; you can redistribute it and/or modify it under the terms of the GNU
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; General Public License (GPL) as published by the Free Software
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; The contents of this file may alternatively be used under the terms
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; of the Common Development and Distribution License Version 1.0
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; VirtualBox OSE distribution, in which case the provisions of the
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; CDDL are applicable instead of those of the GPL.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; You may elect to license modified versions of this file under the
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; terms and conditions of either the GPL or the CDDL or both.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;*******************************************************************************
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;* Header Files *
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;*******************************************************************************
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%define RT_ASM_WITH_SEH64
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%include "iprt/asmdefs.mac"
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync
d16f75bad381547b34a1f315da059b782f4c21d3vboxsyncBEGINCODE
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; Saves extended CPU state.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; @param pXStateArea Pointer to the XSAVE state area.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; msc=rcx, gcc=rdi, x86=[esp+4]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; @param fComponents The 64-bit state component mask.
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync; msc=rdx, gcc=rsi, x86=[esp+8]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync;
d16f75bad381547b34a1f315da059b782f4c21d3vboxsyncBEGINPROC_EXPORTED ASMXSave
d16f75bad381547b34a1f315da059b782f4c21d3vboxsyncSEH64_END_PROLOGUE
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%ifdef ASM_CALL64_MSC
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov rdx, rdx
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync shr rdx, 32
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov eax, edx
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync xsave [rcx]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%elifdef ASM_CALL64_GCC
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov rdx, rsi
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync shr rdx, 32
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov eax, esi
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync xsave [rdi]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%elifdef RT_ARCH_X86
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov ecx, [esp + 4]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov eax, [esp + 8]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync mov edx, [esp + 12]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync xsave [ecx]
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%else
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync %error "Undefined arch?"
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync%endif
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync ret
d16f75bad381547b34a1f315da059b782f4c21d3vboxsyncENDPROC ASMXSave
d16f75bad381547b34a1f315da059b782f4c21d3vboxsync