]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / X64 / DisablePaging64.S
CommitLineData
e8de4680
A
1#------------------------------------------------------------------------------
2#
2c7e5c2f
HT
3# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4# This program and the accompanying materials
e8de4680
A
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.S
15#
16# Abstract:
17#
18# AsmDisablePaging64 function
19#
20# Notes:
21#
22#------------------------------------------------------------------------------
23
24
25#include <EdkIIGlueBase.h>
26#------------------------------------------------------------------------------
27# VOID
28# EFIAPI
29# InternalX86DisablePaging64 (
30# IN UINT16 Cs, %rdi
31# IN UINT64 EntryPoint, %rsi
32# IN UINT64 Context1, OPTIONAL %rdx
33# IN UINT32 Context2, OPTIONAL %rcx
34# IN UINT64 NewStack %r8
35# );
36#------------------------------------------------------------------------------
37
38.globl ASM_PFX(InternalX86DisablePaging64)
39ASM_PFX(InternalX86DisablePaging64):
40 cli
41 shl $0x20,%rcx
42 lea (%rip), %eax
43 mov %eax,%ecx
44 push %rcx
45 mov %edx,%ebx
46 mov %r8d,%esi
47 mov %r9d,%edi
48 mov 0x28(%rsp),%eax
49 lret
50L1:
51 mov %eax,%esp
52 mov %cr0,%rax
53 btr $0x1f,%eax
54 mov %rax,%cr0
55 mov $0xc0000080,%ecx
56 rdmsr
57 and $0xfe,%ah
58 wrmsr
59 mov %cr4,%rax
60 and $0xdf,%al
61 mov %rax,%cr4
62 push %rdi
63 push %rsi
64 callq *%rbx
65 jmp .
66