Refine the inf and dec to follow spec.
[mirror_edk2.git] / Nt32Pkg / CpuRuntimeDxe / CpuDriver.h
CommitLineData
6ae81428 1/**@file\r
770bcbb6 2\r
8f2a5f80
HT
3Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
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
770bcbb6 42\r
770bcbb6 43\r
44extern UINT8 CpuStrings[];\r
45\r
46//\r
47// Internal Data Structures\r
48//\r
99e1dd89 49#define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')\r
770bcbb6 50\r
51typedef struct {\r
52 UINTN Signature;\r
53 EFI_HANDLE Handle;\r
54\r
55 EFI_CPU_ARCH_PROTOCOL Cpu;\r
b8d5cb49 56 EFI_CPU_IO2_PROTOCOL CpuIo;\r
770bcbb6 57\r
58 //\r
59 // Local Data for CPU interface goes here\r
60 //\r
61 CRITICAL_SECTION NtCriticalSection;\r
62 BOOLEAN InterruptState;\r
63\r
64} CPU_ARCH_PROTOCOL_PRIVATE;\r
65\r
66#define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \\r
67 CR (a, \\r
68 CPU_ARCH_PROTOCOL_PRIVATE, \\r
69 Cpu, \\r
70 CPU_ARCH_PROT_PRIVATE_SIGNATURE \\r
71 )\r
72\r
73EFI_STATUS\r
74EFIAPI\r
75CpuMemoryServiceRead (\r
b8d5cb49 76 IN EFI_CPU_IO2_PROTOCOL *This,\r
770bcbb6 77 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
78 IN UINT64 Address,\r
79 IN UINTN Count,\r
80 IN OUT VOID *Buffer\r
81 );\r
82\r
83EFI_STATUS\r
84EFIAPI\r
85CpuMemoryServiceWrite (\r
b8d5cb49 86 IN EFI_CPU_IO2_PROTOCOL *This,\r
770bcbb6 87 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
88 IN UINT64 Address,\r
89 IN UINTN Count,\r
90 IN OUT VOID *Buffer\r
91 );\r
92\r
93EFI_STATUS\r
94EFIAPI\r
95CpuIoServiceRead (\r
b8d5cb49 96 IN EFI_CPU_IO2_PROTOCOL *This,\r
770bcbb6 97 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
98 IN UINT64 UserAddress,\r
99 IN UINTN Count,\r
100 IN OUT VOID *UserBuffer\r
101 );\r
102\r
103EFI_STATUS\r
104EFIAPI\r
105CpuIoServiceWrite (\r
b8d5cb49 106 IN EFI_CPU_IO2_PROTOCOL *This,\r
770bcbb6 107 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
108 IN UINT64 UserAddress,\r
109 IN UINTN Count,\r
110 IN OUT VOID *UserBuffer\r
111 );\r
112\r
113\r
b397fbbb
A
114EFI_STATUS\r
115EFIAPI\r
116InitializeCpu (\r
117 IN EFI_HANDLE ImageHandle,\r
118 IN EFI_SYSTEM_TABLE *SystemTable\r
119 );\r
120\r
121EFI_STATUS\r
122EFIAPI\r
123WinNtFlushCpuDataCache (\r
124 IN EFI_CPU_ARCH_PROTOCOL *This,\r
125 IN EFI_PHYSICAL_ADDRESS Start,\r
126 IN UINT64 Length,\r
127 IN EFI_CPU_FLUSH_TYPE FlushType\r
128 );\r
129\r
130EFI_STATUS\r
131EFIAPI\r
132WinNtEnableInterrupt (\r
133 IN EFI_CPU_ARCH_PROTOCOL *This\r
134 );\r
135\r
136EFI_STATUS\r
137EFIAPI\r
138WinNtDisableInterrupt (\r
139 IN EFI_CPU_ARCH_PROTOCOL *This\r
140 );\r
141\r
142EFI_STATUS\r
143EFIAPI\r
144WinNtGetInterruptState (\r
145 IN EFI_CPU_ARCH_PROTOCOL *This,\r
146 OUT BOOLEAN *State\r
147 );\r
148\r
149EFI_STATUS\r
150EFIAPI\r
151WinNtInit (\r
152 IN EFI_CPU_ARCH_PROTOCOL *This,\r
153 IN EFI_CPU_INIT_TYPE InitType\r
154 );\r
155\r
156EFI_STATUS\r
157EFIAPI\r
158WinNtRegisterInterruptHandler (\r
159 IN EFI_CPU_ARCH_PROTOCOL *This,\r
160 IN EFI_EXCEPTION_TYPE InterruptType,\r
161 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
162 );\r
163\r
164EFI_STATUS\r
165EFIAPI\r
166WinNtGetTimerValue (\r
167 IN EFI_CPU_ARCH_PROTOCOL *This,\r
168 IN UINT32 TimerIndex,\r
169 OUT UINT64 *TimerValue,\r
170 OUT UINT64 *TimerPeriod OPTIONAL\r
171 );\r
172\r
173EFI_STATUS\r
174EFIAPI\r
175WinNtSetMemoryAttributes (\r
176 IN EFI_CPU_ARCH_PROTOCOL *This,\r
177 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
178 IN UINT64 Length,\r
179 IN UINT64 Attributes\r
180 );\r
181\r
182\r
183\r
184\r
185\r
186\r
770bcbb6 187#endif\r