removed gEfiWinNtCPUSpeedGuid, gEfiWinNtCPUModelGuid, and gEfiWinNtMemoryGuid. Replac...
[mirror_edk2.git] / Nt32Pkg / CpuRuntimeDxe / CpuDriver.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 CpuDriver.h
15
16 Abstract:
17
18 NT Emulation Architectural Protocol Driver as defined in Tiano.
19
20 --*/
21
22 #ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
23 #define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
24
25
26 #include <FrameworkDxe.h>
27 #include <Protocol/Cpu.h>
28 #include <Protocol/DataHub.h>
29 #include <Protocol/HiiFramework.h>
30 #include <Guid/DataHubRecords.h>
31 #include <Protocol/CpuIo.h>
32 #include <Protocol/WinNtIo.h>
33 #include <Library/BaseLib.h>
34 #include <Library/DebugLib.h>
35 #include <Library/HiiLibFramework.h>
36 #include <Library/UefiDriverEntryPoint.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/MemoryAllocationLib.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/PcdLib.h>
41
42
43 extern UINT8 CpuStrings[];
44
45 //
46 // Internal Data Structures
47 //
48 #define CPU_ARCH_PROT_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('c', 'a', 'p', 'd')
49
50 typedef struct {
51 UINTN Signature;
52 EFI_HANDLE Handle;
53
54 EFI_CPU_ARCH_PROTOCOL Cpu;
55 EFI_CPU_IO_PROTOCOL CpuIo;
56
57 //
58 // Local Data for CPU interface goes here
59 //
60 CRITICAL_SECTION NtCriticalSection;
61 BOOLEAN InterruptState;
62
63 } CPU_ARCH_PROTOCOL_PRIVATE;
64
65 #define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \
66 CR (a, \
67 CPU_ARCH_PROTOCOL_PRIVATE, \
68 Cpu, \
69 CPU_ARCH_PROT_PRIVATE_SIGNATURE \
70 )
71
72 EFI_STATUS
73 EFIAPI
74 CpuMemoryServiceRead (
75 IN EFI_CPU_IO_PROTOCOL *This,
76 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
77 IN UINT64 Address,
78 IN UINTN Count,
79 IN OUT VOID *Buffer
80 );
81
82 EFI_STATUS
83 EFIAPI
84 CpuMemoryServiceWrite (
85 IN EFI_CPU_IO_PROTOCOL *This,
86 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
87 IN UINT64 Address,
88 IN UINTN Count,
89 IN OUT VOID *Buffer
90 );
91
92 EFI_STATUS
93 EFIAPI
94 CpuIoServiceRead (
95 IN EFI_CPU_IO_PROTOCOL *This,
96 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
97 IN UINT64 UserAddress,
98 IN UINTN Count,
99 IN OUT VOID *UserBuffer
100 );
101
102 EFI_STATUS
103 EFIAPI
104 CpuIoServiceWrite (
105 IN EFI_CPU_IO_PROTOCOL *This,
106 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
107 IN UINT64 UserAddress,
108 IN UINTN Count,
109 IN OUT VOID *UserBuffer
110 );
111
112
113 EFI_STATUS
114 EFIAPI
115 InitializeCpu (
116 IN EFI_HANDLE ImageHandle,
117 IN EFI_SYSTEM_TABLE *SystemTable
118 );
119
120 EFI_STATUS
121 EFIAPI
122 WinNtFlushCpuDataCache (
123 IN EFI_CPU_ARCH_PROTOCOL *This,
124 IN EFI_PHYSICAL_ADDRESS Start,
125 IN UINT64 Length,
126 IN EFI_CPU_FLUSH_TYPE FlushType
127 );
128
129 EFI_STATUS
130 EFIAPI
131 WinNtEnableInterrupt (
132 IN EFI_CPU_ARCH_PROTOCOL *This
133 );
134
135 EFI_STATUS
136 EFIAPI
137 WinNtDisableInterrupt (
138 IN EFI_CPU_ARCH_PROTOCOL *This
139 );
140
141 EFI_STATUS
142 EFIAPI
143 WinNtGetInterruptState (
144 IN EFI_CPU_ARCH_PROTOCOL *This,
145 OUT BOOLEAN *State
146 );
147
148 EFI_STATUS
149 EFIAPI
150 WinNtInit (
151 IN EFI_CPU_ARCH_PROTOCOL *This,
152 IN EFI_CPU_INIT_TYPE InitType
153 );
154
155 EFI_STATUS
156 EFIAPI
157 WinNtRegisterInterruptHandler (
158 IN EFI_CPU_ARCH_PROTOCOL *This,
159 IN EFI_EXCEPTION_TYPE InterruptType,
160 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
161 );
162
163 EFI_STATUS
164 EFIAPI
165 WinNtGetTimerValue (
166 IN EFI_CPU_ARCH_PROTOCOL *This,
167 IN UINT32 TimerIndex,
168 OUT UINT64 *TimerValue,
169 OUT UINT64 *TimerPeriod OPTIONAL
170 );
171
172 EFI_STATUS
173 EFIAPI
174 WinNtSetMemoryAttributes (
175 IN EFI_CPU_ARCH_PROTOCOL *This,
176 IN EFI_PHYSICAL_ADDRESS BaseAddress,
177 IN UINT64 Length,
178 IN UINT64 Attributes
179 );
180
181
182
183
184
185
186 #endif