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