]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/CpuRuntimeDxe/CpuDriver.h
Update the copyright notice format
[mirror_edk2.git] / UnixPkg / CpuRuntimeDxe / CpuDriver.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 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 UNIX 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
27 extern UINT8 CpuStrings[];
28
29 //
30 // Internal Data Structures
31 //
32 #define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')
33
34 typedef struct {
35 UINTN Signature;
36 EFI_HANDLE Handle;
37
38 EFI_CPU_ARCH_PROTOCOL Cpu;
39 EFI_CPU_IO2_PROTOCOL CpuIo;
40
41 //
42 // Local Data for CPU interface goes here
43 //
44 BOOLEAN InterruptState;
45
46 } CPU_ARCH_PROTOCOL_PRIVATE;
47
48 #define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \
49 CR (a, \
50 CPU_ARCH_PROTOCOL_PRIVATE, \
51 Cpu, \
52 CPU_ARCH_PROT_PRIVATE_SIGNATURE \
53 )
54
55 EFI_STATUS
56 EFIAPI
57 CpuMemoryServiceRead (
58 IN EFI_CPU_IO2_PROTOCOL *This,
59 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
60 IN UINT64 Address,
61 IN UINTN Count,
62 IN OUT VOID *Buffer
63 );
64
65 EFI_STATUS
66 EFIAPI
67 CpuMemoryServiceWrite (
68 IN EFI_CPU_IO2_PROTOCOL *This,
69 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
70 IN UINT64 Address,
71 IN UINTN Count,
72 IN OUT VOID *Buffer
73 );
74
75 EFI_STATUS
76 EFIAPI
77 CpuIoServiceRead (
78 IN EFI_CPU_IO2_PROTOCOL *This,
79 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
80 IN UINT64 UserAddress,
81 IN UINTN Count,
82 IN OUT VOID *UserBuffer
83 );
84
85 EFI_STATUS
86 EFIAPI
87 CpuIoServiceWrite (
88 IN EFI_CPU_IO2_PROTOCOL *This,
89 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
90 IN UINT64 UserAddress,
91 IN UINTN Count,
92 IN OUT VOID *UserBuffer
93 );
94
95 EFI_STATUS
96 EFIAPI
97 InitializeCpu (
98 IN EFI_HANDLE ImageHandle,
99 IN EFI_SYSTEM_TABLE *SystemTable
100 );
101
102 EFI_STATUS
103 EFIAPI
104 UnixFlushCpuDataCache (
105 IN EFI_CPU_ARCH_PROTOCOL *This,
106 IN EFI_PHYSICAL_ADDRESS Start,
107 IN UINT64 Length,
108 IN EFI_CPU_FLUSH_TYPE FlushType
109 );
110
111 EFI_STATUS
112 EFIAPI
113 UnixEnableInterrupt (
114 IN EFI_CPU_ARCH_PROTOCOL *This
115 );
116
117 EFI_STATUS
118 EFIAPI
119 UnixDisableInterrupt (
120 IN EFI_CPU_ARCH_PROTOCOL *This
121 );
122
123 EFI_STATUS
124 EFIAPI
125 UnixGetInterruptState (
126 IN EFI_CPU_ARCH_PROTOCOL *This,
127 OUT BOOLEAN *State
128 );
129
130 EFI_STATUS
131 EFIAPI
132 UnixInit (
133 IN EFI_CPU_ARCH_PROTOCOL *This,
134 IN EFI_CPU_INIT_TYPE InitType
135 );
136
137 EFI_STATUS
138 EFIAPI
139 UnixRegisterInterruptHandler (
140 IN EFI_CPU_ARCH_PROTOCOL *This,
141 IN EFI_EXCEPTION_TYPE InterruptType,
142 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
143 );
144
145 EFI_STATUS
146 EFIAPI
147 UnixGetTimerValue (
148 IN EFI_CPU_ARCH_PROTOCOL *This,
149 IN UINT32 TimerIndex,
150 OUT UINT64 *TimerValue,
151 OUT UINT64 *TimerPeriod OPTIONAL
152 );
153
154 EFI_STATUS
155 EFIAPI
156 UnixSetMemoryAttributes (
157 IN EFI_CPU_ARCH_PROTOCOL *This,
158 IN EFI_PHYSICAL_ADDRESS BaseAddress,
159 IN UINT64 Length,
160 IN UINT64 Attributes
161 );
162
163 #endif