]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
MdePkg: Replace BSD License with BSD+Patent License
[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
10 #include "BaseLibInternals.h"
11
12 /**
13 Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
14
15 Writes the current IDTR descriptor and returns it in Idtr. This function is
16 only available on IA-32 and x64.
17
18 @param Idtr The pointer to a IDTR descriptor.
19
20 **/
21 VOID
22 EFIAPI
23 InternalX86WriteIdtr (
24 IN CONST IA32_DESCRIPTOR *Idtr
25 )
26 {
27 _asm {
28 mov eax, Idtr
29 pushfd
30 cli
31 lidt fword ptr [eax]
32 popfd
33 }
34 }
35