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