]>
Commit | Line | Data |
---|---|---|
6ae81428 | 1 | /**@file\r |
770bcbb6 | 2 | \r |
831ff057 | 3 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
8f2a5f80 | 4 | This program and the accompanying materials \r |
770bcbb6 | 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 | CpuDriver.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | NT Emulation Architectural Protocol Driver as defined in Tiano.\r | |
19 | \r | |
6ae81428 | 20 | **/\r |
770bcbb6 | 21 | \r |
22 | #ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r | |
23 | #define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r | |
24 | \r | |
25 | \r | |
f2569572 | 26 | #include <FrameworkDxe.h>\r |
1fdd39d3 | 27 | #include <IndustryStandard/SmBios.h>\r |
f2569572 | 28 | #include <Protocol/Cpu.h>\r |
1fdd39d3 | 29 | #include <Protocol/Smbios.h>\r |
8e5b17b2 | 30 | #include <Protocol/FrameworkHii.h>\r |
f2569572 | 31 | #include <Guid/DataHubRecords.h>\r |
b8d5cb49 | 32 | #include <Protocol/CpuIo2.h>\r |
f2569572 | 33 | #include <Protocol/WinNtIo.h>\r |
b397fbbb | 34 | #include <Library/BaseLib.h>\r |
f2569572 | 35 | #include <Library/DebugLib.h>\r |
8d9bda4f | 36 | #include <Library/HiiLib.h>\r |
f2569572 A |
37 | #include <Library/UefiDriverEntryPoint.h>\r |
38 | #include <Library/BaseMemoryLib.h>\r | |
39 | #include <Library/MemoryAllocationLib.h>\r | |
40 | #include <Library/UefiBootServicesTableLib.h>\r | |
b397fbbb | 41 | #include <Library/PcdLib.h>\r |
831ff057 | 42 | #include <Library/WinNtLib.h>\r |
770bcbb6 | 43 | \r |
770bcbb6 | 44 | \r |
45 | extern UINT8 CpuStrings[];\r | |
46 | \r | |
47 | //\r | |
48 | // Internal Data Structures\r | |
49 | //\r | |
99e1dd89 | 50 | #define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')\r |
770bcbb6 | 51 | \r |
52 | typedef struct {\r | |
53 | UINTN Signature;\r | |
54 | EFI_HANDLE Handle;\r | |
55 | \r | |
56 | EFI_CPU_ARCH_PROTOCOL Cpu;\r | |
b8d5cb49 | 57 | EFI_CPU_IO2_PROTOCOL CpuIo;\r |
770bcbb6 | 58 | \r |
59 | //\r | |
60 | // Local Data for CPU interface goes here\r | |
61 | //\r | |
62 | CRITICAL_SECTION NtCriticalSection;\r | |
63 | BOOLEAN InterruptState;\r | |
64 | \r | |
65 | } CPU_ARCH_PROTOCOL_PRIVATE;\r | |
66 | \r | |
67 | #define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \\r | |
68 | CR (a, \\r | |
69 | CPU_ARCH_PROTOCOL_PRIVATE, \\r | |
70 | Cpu, \\r | |
71 | CPU_ARCH_PROT_PRIVATE_SIGNATURE \\r | |
72 | )\r | |
73 | \r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | CpuMemoryServiceRead (\r | |
b8d5cb49 | 77 | IN EFI_CPU_IO2_PROTOCOL *This,\r |
770bcbb6 | 78 | IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r |
79 | IN UINT64 Address,\r | |
80 | IN UINTN Count,\r | |
81 | IN OUT VOID *Buffer\r | |
82 | );\r | |
83 | \r | |
84 | EFI_STATUS\r | |
85 | EFIAPI\r | |
86 | CpuMemoryServiceWrite (\r | |
b8d5cb49 | 87 | IN EFI_CPU_IO2_PROTOCOL *This,\r |
770bcbb6 | 88 | IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r |
89 | IN UINT64 Address,\r | |
90 | IN UINTN Count,\r | |
91 | IN OUT VOID *Buffer\r | |
92 | );\r | |
93 | \r | |
94 | EFI_STATUS\r | |
95 | EFIAPI\r | |
96 | CpuIoServiceRead (\r | |
b8d5cb49 | 97 | IN EFI_CPU_IO2_PROTOCOL *This,\r |
770bcbb6 | 98 | IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r |
99 | IN UINT64 UserAddress,\r | |
100 | IN UINTN Count,\r | |
101 | IN OUT VOID *UserBuffer\r | |
102 | );\r | |
103 | \r | |
104 | EFI_STATUS\r | |
105 | EFIAPI\r | |
106 | CpuIoServiceWrite (\r | |
b8d5cb49 | 107 | IN EFI_CPU_IO2_PROTOCOL *This,\r |
770bcbb6 | 108 | IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r |
109 | IN UINT64 UserAddress,\r | |
110 | IN UINTN Count,\r | |
111 | IN OUT VOID *UserBuffer\r | |
112 | );\r | |
113 | \r | |
114 | \r | |
b397fbbb A |
115 | EFI_STATUS\r |
116 | EFIAPI\r | |
117 | InitializeCpu (\r | |
118 | IN EFI_HANDLE ImageHandle,\r | |
119 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
120 | );\r | |
121 | \r | |
122 | EFI_STATUS\r | |
123 | EFIAPI\r | |
124 | WinNtFlushCpuDataCache (\r | |
125 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
126 | IN EFI_PHYSICAL_ADDRESS Start,\r | |
127 | IN UINT64 Length,\r | |
128 | IN EFI_CPU_FLUSH_TYPE FlushType\r | |
129 | );\r | |
130 | \r | |
131 | EFI_STATUS\r | |
132 | EFIAPI\r | |
133 | WinNtEnableInterrupt (\r | |
134 | IN EFI_CPU_ARCH_PROTOCOL *This\r | |
135 | );\r | |
136 | \r | |
137 | EFI_STATUS\r | |
138 | EFIAPI\r | |
139 | WinNtDisableInterrupt (\r | |
140 | IN EFI_CPU_ARCH_PROTOCOL *This\r | |
141 | );\r | |
142 | \r | |
143 | EFI_STATUS\r | |
144 | EFIAPI\r | |
145 | WinNtGetInterruptState (\r | |
146 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
147 | OUT BOOLEAN *State\r | |
148 | );\r | |
149 | \r | |
150 | EFI_STATUS\r | |
151 | EFIAPI\r | |
152 | WinNtInit (\r | |
153 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
154 | IN EFI_CPU_INIT_TYPE InitType\r | |
155 | );\r | |
156 | \r | |
157 | EFI_STATUS\r | |
158 | EFIAPI\r | |
159 | WinNtRegisterInterruptHandler (\r | |
160 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
161 | IN EFI_EXCEPTION_TYPE InterruptType,\r | |
162 | IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r | |
163 | );\r | |
164 | \r | |
165 | EFI_STATUS\r | |
166 | EFIAPI\r | |
167 | WinNtGetTimerValue (\r | |
168 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
169 | IN UINT32 TimerIndex,\r | |
170 | OUT UINT64 *TimerValue,\r | |
171 | OUT UINT64 *TimerPeriod OPTIONAL\r | |
172 | );\r | |
173 | \r | |
174 | EFI_STATUS\r | |
175 | EFIAPI\r | |
176 | WinNtSetMemoryAttributes (\r | |
177 | IN EFI_CPU_ARCH_PROTOCOL *This,\r | |
178 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
179 | IN UINT64 Length,\r | |
180 | IN UINT64 Attributes\r | |
181 | );\r | |
182 | \r | |
183 | \r | |
184 | \r | |
185 | \r | |
186 | \r | |
187 | \r | |
770bcbb6 | 188 | #endif\r |