]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadGdtr.c
1 /** @file
2 AsmReadGdtr function
3
4 Copyright (c) 2006 - 2008, 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 /**
14 Reads the current Global Descriptor Table Register(GDTR) descriptor.
15
16 Reads and returns the current GDTR descriptor and returns it in Gdtr. This
17 function is only available on IA-32 and x64.
18
19 @param Gdtr The pointer to a GDTR descriptor.
20
21 **/
22 VOID
23 EFIAPI
24 InternalX86ReadGdtr (
25 OUT IA32_DESCRIPTOR *Gdtr
26 )
27 {
28 _asm {
29 mov eax, Gdtr
30 sgdt fword ptr [eax]
31 }
32 }
33