BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / Nt32Pkg / CpuRuntimeDxe / CpuDriver.h
CommitLineData
6ae81428 1/**@file\r
770bcbb6 2\r
831ff057 3Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
8f2a5f80 4This program and the accompanying materials \r
770bcbb6 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 CpuDriver.h\r
15\r
16Abstract:\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
45extern 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
52typedef 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
74EFI_STATUS\r
75EFIAPI\r
76CpuMemoryServiceRead (\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
84EFI_STATUS\r
85EFIAPI\r
86CpuMemoryServiceWrite (\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
94EFI_STATUS\r
95EFIAPI\r
96CpuIoServiceRead (\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
104EFI_STATUS\r
105EFIAPI\r
106CpuIoServiceWrite (\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
115EFI_STATUS\r
116EFIAPI\r
117InitializeCpu (\r
118 IN EFI_HANDLE ImageHandle,\r
119 IN EFI_SYSTEM_TABLE *SystemTable\r
120 );\r
121\r
122EFI_STATUS\r
123EFIAPI\r
124WinNtFlushCpuDataCache (\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
131EFI_STATUS\r
132EFIAPI\r
133WinNtEnableInterrupt (\r
134 IN EFI_CPU_ARCH_PROTOCOL *This\r
135 );\r
136\r
137EFI_STATUS\r
138EFIAPI\r
139WinNtDisableInterrupt (\r
140 IN EFI_CPU_ARCH_PROTOCOL *This\r
141 );\r
142\r
143EFI_STATUS\r
144EFIAPI\r
145WinNtGetInterruptState (\r
146 IN EFI_CPU_ARCH_PROTOCOL *This,\r
147 OUT BOOLEAN *State\r
148 );\r
149\r
150EFI_STATUS\r
151EFIAPI\r
152WinNtInit (\r
153 IN EFI_CPU_ARCH_PROTOCOL *This,\r
154 IN EFI_CPU_INIT_TYPE InitType\r
155 );\r
156\r
157EFI_STATUS\r
158EFIAPI\r
159WinNtRegisterInterruptHandler (\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
165EFI_STATUS\r
166EFIAPI\r
167WinNtGetTimerValue (\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
174EFI_STATUS\r
175EFIAPI\r
176WinNtSetMemoryAttributes (\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