]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / WriteIdtr.c
1 /** @file
2 AsmWriteIdtr function
3
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "BaseLibInternals.h"
10
11 /**
12 Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
13
14 Writes the current IDTR descriptor and returns it in Idtr. This function is
15 only available on IA-32 and x64.
16
17 @param Idtr The pointer to a IDTR descriptor.
18
19 **/
20 VOID
21 EFIAPI
22 InternalX86WriteIdtr (
23 IN CONST IA32_DESCRIPTOR *Idtr
24 )
25 {
26 _asm {
27 mov eax, Idtr
28 pushfd
29 cli
30 lidt fword ptr [eax]
31 popfd
32 }
33 }