]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/CpuMpPei/Ia32/MpFuncs.nasm
180b637ae6abfc5a5f3ab9903fdfeb283ee0deb8
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / Ia32 / MpFuncs.nasm
1 ;------------------------------------------------------------------------------ ;
2 ; Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
3 ; This program and the accompanying materials
4 ; are licensed and made available under the terms and conditions of the BSD License
5 ; which accompanies this distribution. The full text of the license may be found at
6 ; http://opensource.org/licenses/bsd-license.php.
7 ;
8 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
10 ;
11 ; Module Name:
12 ;
13 ; MpFuncs.nasm
14 ;
15 ; Abstract:
16 ;
17 ; This is the assembly code for MP support
18 ;
19 ;-------------------------------------------------------------------------------
20
21 %include "MpEqu.inc"
22
23 SECTION .text
24
25
26 global ASM_PFX(AsmInitializeGdt)
27 ASM_PFX(AsmInitializeGdt):
28 push ebp
29 mov ebp, esp
30 pushad
31 mov edi, [ebp + 8] ; Load GDT register
32
33 lgdt [edi] ; and update the GDTR
34
35 push PROTECT_MODE_CS
36 mov eax, ASM_PFX(SetCodeSelectorFarJump)
37 push eax
38 retf
39 ASM_PFX(SetCodeSelectorFarJump):
40 mov ax, PROTECT_MODE_DS ; Update the Base for the new selectors, too
41 mov ds, ax
42 mov es, ax
43 mov fs, ax
44 mov gs, ax
45 mov ss, ax
46
47 popad
48 pop ebp
49 ret