VirtualBox

Changeset 50424 in vbox


Ignore:
Timestamp:
Feb 12, 2014 12:26:55 PM (11 years ago)
Author:
vboxsync
Message:

ASMSetIDTR and ASMSetGDTR.

Location:
trunk
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm-amd64-x86.h

    r49845 r50424  
    186186#endif
    187187
     188
     189/**
     190 * Sets the content of the GDTR CPU register.
     191 * @param   pIdtr   Where to load the GDTR contents from
     192 */
     193#if RT_INLINE_ASM_EXTERNAL
     194DECLASM(void) ASMSetGDTR(const RTGDTR *pGdtr);
     195#else
     196DECLINLINE(void) ASMSetGDTR(const RTGDTR *pGdtr)
     197{
     198# if RT_INLINE_ASM_GNU_STYLE
     199    __asm__ __volatile__("lgdt %0" : : "m" (*pGdtr));
     200# else
     201    __asm
     202    {
     203#  ifdef RT_ARCH_AMD64
     204        mov     rax, [pGdtr]
     205        lgdt    [rax]
     206#  else
     207        mov     eax, [pGdtr]
     208        lgdt    [eax]
     209#  endif
     210    }
     211# endif
     212}
     213#endif
     214
     215
     216
    188217/**
    189218 * Get the cs register.
  • trunk/src/VBox/Runtime/Makefile.kmk

    r50408 r50424  
    184184        common/asm/ASMNopPause.asm \
    185185        common/asm/ASMGetIDTR.asm \
     186        common/asm/ASMSetIDTR.asm \
    186187        common/asm/ASMGetGDTR.asm \
     188        common/asm/ASMSetGDTR.asm \
    187189        common/asm/ASMGetLDTR.asm \
    188190        common/asm/ASMGetSegAttr.asm \
  • trunk/src/VBox/Runtime/common/asm/ASMSetGDTR.asm

    r50388 r50424  
    11; $Id$
    22;; @file
    3 ; IPRT - ASMGetGDTR().
     3; IPRT - ASMSetGDTR().
    44;
    55
    66;
    7 ; Copyright (C) 2006-2013 Oracle Corporation
     7; Copyright (C) 2006-2014 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.
     35; Sets the content of the GDTR CPU register.
     36; @param   pGdtr    Where to load the GDTR contents from.
    3737;                   msc=rcx, gcc=rdi, x86=[esp+4]
    3838;
    39 BEGINPROC_EXPORTED ASMGetGDTR
     39BEGINPROC_EXPORTED ASMSetGDTR
    4040%ifdef ASM_CALL64_MSC
    4141        mov     rax, rcx
     
    4747 %error "Undefined arch?"
    4848%endif
    49         sgdt    [xAX]
     49        lgdt    [xAX]
    5050        ret
    51 ENDPROC ASMGetGDTR
     51ENDPROC ASMSetGDTR
    5252
  • trunk/src/VBox/Runtime/common/asm/ASMSetIDTR.asm

    r50388 r50424  
    11; $Id$
    22;; @file
    3 ; IPRT - ASMGetGDTR().
     3; IPRT - ASMSetIDTR().
    44;
    55
    66;
    7 ; Copyright (C) 2006-2013 Oracle Corporation
     7; Copyright (C) 2006-2014 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.
     35; Sets the content of the IDTR CPU register.
     36; @param   pIdtr    Where to load the IDTR contents from.
    3737;                   msc=rcx, gcc=rdi, x86=[esp+4]
    3838;
    39 BEGINPROC_EXPORTED ASMGetGDTR
     39BEGINPROC_EXPORTED ASMSetIDTR
    4040%ifdef ASM_CALL64_MSC
    4141        mov     rax, rcx
     
    4747 %error "Undefined arch?"
    4848%endif
    49         sgdt    [xAX]
     49        lidt    [xAX]
    5050        ret
    51 ENDPROC ASMGetGDTR
     51ENDPROC ASMSetIDTR
    5252
Note: See TracChangeset for help on using the changeset viewer.

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