]>
Commit | Line | Data |
---|---|---|
a47463f2 | 1 | /** @file\r |
2 | CPU DXE Module.\r | |
3 | \r | |
4 | Copyright (c) 2008 - 2009, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _CPU_DXE_H\r | |
16 | #define _CPU_DXE_H\r | |
17 | \r | |
18 | #include <PiDxe.h>\r | |
19 | \r | |
20 | #include <Protocol/Cpu.h>\r | |
21 | \r | |
22 | #include <Library/UefiDriverEntryPoint.h>\r | |
23 | #include <Library/UefiBootServicesTableLib.h>\r | |
24 | #include <Library/DxeServicesTableLib.h>\r | |
25 | #include <Library/BaseLib.h>\r | |
26 | #include <Library/CpuLib.h>\r | |
27 | #include <Library/BaseMemoryLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/DebugLib.h>\r | |
30 | #include <Library/MtrrLib.h>\r | |
31 | \r | |
32 | //\r | |
33 | //\r | |
34 | //\r | |
35 | #define INTERRUPT_VECTOR_NUMBER 256\r | |
36 | \r | |
37 | #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \\r | |
38 | EFI_MEMORY_WC | \\r | |
39 | EFI_MEMORY_WT | \\r | |
40 | EFI_MEMORY_WB | \\r | |
41 | EFI_MEMORY_UCE \\r | |
42 | )\r | |
43 | \r | |
44 | \r | |
45 | //\r | |
46 | // Function declarations\r | |
47 | //\r | |
48 | EFI_STATUS\r | |
49 | EFIAPI\r | |
50 | CpuFlushCpuDataCache (\r | |
51 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
52 | IN EFI_PHYSICAL_ADDRESS Start,\r | |
53 | IN UINT64 Length,\r | |
54 | IN EFI_CPU_FLUSH_TYPE FlushType\r | |
55 | );\r | |
56 | \r | |
57 | EFI_STATUS\r | |
58 | EFIAPI\r | |
59 | CpuEnableInterrupt (\r | |
60 | IN EFI_CPU_ARCH_PROTOCOL *This\r | |
61 | );\r | |
62 | \r | |
63 | EFI_STATUS\r | |
64 | EFIAPI\r | |
65 | CpuDisableInterrupt (\r | |
66 | IN EFI_CPU_ARCH_PROTOCOL *This\r | |
67 | );\r | |
68 | \r | |
69 | EFI_STATUS\r | |
70 | EFIAPI\r | |
71 | CpuGetInterruptState (\r | |
72 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
73 | OUT BOOLEAN *State\r | |
74 | );\r | |
75 | \r | |
76 | EFI_STATUS\r | |
77 | EFIAPI\r | |
78 | CpuInit (\r | |
79 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
80 | IN EFI_CPU_INIT_TYPE InitType\r | |
81 | );\r | |
82 | \r | |
83 | EFI_STATUS\r | |
84 | EFIAPI\r | |
85 | CpuRegisterInterruptHandler (\r | |
86 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
87 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
88 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
89 | );\r | |
90 | \r | |
91 | EFI_STATUS\r | |
92 | EFIAPI\r | |
93 | CpuGetTimerValue (\r | |
94 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
95 | IN UINT32 TimerIndex,\r | |
96 | OUT UINT64 *TimerValue,\r | |
97 | OUT UINT64 *TimerPeriod OPTIONAL\r | |
98 | );\r | |
99 | \r | |
100 | EFI_STATUS\r | |
101 | EFIAPI\r | |
102 | CpuSetMemoryAttributes (\r | |
103 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
104 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
105 | IN UINT64 Length,\r | |
106 | IN UINT64 Attributes\r | |
107 | );\r | |
108 | \r | |
109 | VOID\r | |
110 | EFIAPI\r | |
111 | AsmIdtVector00 (\r | |
112 | VOID\r | |
113 | );\r | |
114 | \r | |
115 | VOID\r | |
116 | EFIAPI\r | |
117 | InitializeExternalVectorTablePtr (\r | |
118 | EFI_CPU_INTERRUPT_HANDLER *VectorTable\r | |
119 | );\r | |
120 | \r | |
121 | VOID\r | |
122 | InitGlobalDescriptorTable (\r | |
123 | VOID\r | |
124 | );\r | |
125 | \r | |
126 | VOID\r | |
127 | EFIAPI\r | |
128 | SetCodeSelector (\r | |
129 | UINT16 Selector\r | |
130 | );\r | |
131 | \r | |
132 | VOID\r | |
133 | EFIAPI\r | |
134 | SetDataSelectors (\r | |
135 | UINT16 Selector\r | |
136 | );\r | |
137 | \r | |
138 | \r | |
139 | #endif\r | |
140 | \r |