]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S
sync comments on data structure to follow latest UEFI spec.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / X64 / DisablePaging64.S
CommitLineData
b341712e 1#------------------------------------------------------------------------------\r
2#\r
3# Copyright (c) 2006, Intel Corporation\r
4# All rights reserved. This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php\r
8#\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12# Module Name:\r
13#\r
14# DisablePaging64.S\r
15#\r
16# Abstract:\r
17#\r
18# AsmDisablePaging64 function\r
19#\r
20# Notes:\r
21#\r
22#------------------------------------------------------------------------------\r
23\r
24 \r
25#include <EdkIIGlueBase.h>\r
26#------------------------------------------------------------------------------\r
27# VOID\r
28# EFIAPI\r
29# InternalX86DisablePaging64 (\r
30# IN UINT16 Cs, %rdi\r
31# IN UINT64 EntryPoint, %rsi\r
32# IN UINT64 Context1, OPTIONAL %rdx\r
33# IN UINT32 Context2, OPTIONAL %rcx\r
34# IN UINT64 NewStack %r8\r
35# );\r
36#------------------------------------------------------------------------------\r
37\r
38.global ASM_PFX(InternalX86DisablePaging64)\r
39ASM_PFX(InternalX86DisablePaging64):\r
40 cli \r
41 shl $0x20,%rcx\r
42 lea (%rip), %eax\r
43 mov %eax,%ecx\r
44 push %rcx\r
45 mov %edx,%ebx\r
46 mov %r8d,%esi\r
47 mov %r9d,%edi\r
48 mov 0x28(%rsp),%eax\r
49 lret \r
50L1:\r
51 mov %eax,%esp\r
52 mov %cr0,%rax\r
53 btr $0x1f,%eax\r
54 mov %rax,%cr0\r
55 mov $0xc0000080,%ecx\r
56 rdmsr \r
57 and $0xfe,%ah\r
58 wrmsr \r
59 mov %cr4,%rax\r
60 and $0xdf,%al\r
61 mov %rax,%cr4\r
62 push %rdi\r
63 push %rsi\r
64 callq *%rbx\r
65 jmp .\r
66\r