]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X64/DisablePaging64.asm
Rename dirs
[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 ecx, @F
30 push rcx
31 mov ebx, edx
32 mov esi, r8d
33 mov edi, r9d
34 mov eax, [rsp + 28h]
35 retf
36 @@:
37 mov esp, eax ; set up new stack
38 mov rax, cr0
39 btr eax, 31
40 mov cr0, rax ; disable paging
41 mov ecx, 0c0000080h
42 rdmsr
43 and ah, NOT 1 ; clear LME
44 wrmsr
45 mov rax, cr4
46 and al, NOT (1 SHL 5) ; clear PAE
47 mov cr4, rax
48 push rdi
49 push rsi
50 call rbx
51 jmp $
52 InternalX86DisablePaging64 ENDP
53
54 END