]>
Commit | Line | Data |
---|---|---|
f1baef62 | 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 | # EnablePaging64.S | |
15 | # | |
16 | # Abstract: | |
17 | # | |
18 | # AsmEnablePaging64 function | |
19 | # | |
20 | # Notes: | |
21 | # | |
22 | #------------------------------------------------------------------------------ | |
23 | ||
24 | ||
25 | #------------------------------------------------------------------------------ | |
26 | # VOID | |
27 | # EFIAPI | |
28 | # InternalX86EnablePaging64 ( | |
29 | # IN UINT16 Cs, %rdi | |
30 | # IN UINT64 EntryPoint, %rsi | |
31 | # IN UINT64 Context1, OPTIONAL %rdx | |
32 | # IN UINT64 Context2, OPTIONAL %rcx | |
33 | # IN UINT64 NewStack %r8 | |
34 | # ); | |
35 | #------------------------------------------------------------------------------ | |
36 | .global _InternalX86EnablePaging64; | |
37 | _InternalX86EnablePaging64: | |
38 | cli | |
39 | pop %rax | |
40 | callq Base | |
41 | Base: | |
42 | addl $(L1-Base),(%rsp) | |
43 | mov %cr4,%rax | |
44 | or $0x20,%al | |
45 | mov %rax,%cr4 | |
46 | mov $0xc0000080,%ecx | |
47 | rdmsr | |
48 | or $0x1,%ah | |
49 | wrmsr | |
50 | mov %cr0,%rax | |
51 | bts $0x1f,%eax | |
52 | mov %rax,%cr0 | |
53 | lret | |
54 | L1: | |
55 | addr32 mov (%esp),%rbx | |
56 | addr32 mov 0x8(%esp),%rcx | |
57 | addr32 mov 0x10(%esp),%rdx | |
58 | addr32 mov 0x18(%esp),%rsp | |
59 | add $-0x20,%rsp | |
60 | callq *%rbx | |
61 | jmp . |