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