]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X64/DisablePaging64.asm
Add check when copy flashMap.h to ${ModuleOutputDir}/Debug/TianoR8FlashMap.h.
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / DisablePaging64.asm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation
4 ; All rights reserved. This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php
8 ;
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ; Module Name:
13 ;
14 ; DisablePaging64.Asm
15 ;
16 ; Abstract:
17 ;
18 ; AsmDisablePaging64 function
19 ;
20 ; Notes:
21 ;
22 ;------------------------------------------------------------------------------
23
24 .code
25
26 InternalX86DisablePaging64 PROC
27 cli
28 shl rcx, 32
29 lea eax, @F
30 mov ecx, eax
31 push rcx
32 mov ebx, edx
33 mov esi, r8d
34 mov edi, r9d
35 mov eax, [rsp + 28h]
36 retf
37 @@:
38 mov esp, eax ; set up new stack
39 mov rax, cr0
40 btr eax, 31
41 mov cr0, rax ; disable paging
42 mov ecx, 0c0000080h
43 rdmsr
44 and ah, NOT 1 ; clear LME
45 wrmsr
46 mov rax, cr4
47 and al, NOT (1 SHL 5) ; clear PAE
48 mov cr4, rax
49 push rdi
50 push rsi
51 call rbx
52 jmp $
53 InternalX86DisablePaging64 ENDP
54
55 END