3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 Portions copyright (c) 2011, Apple Inc. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
16 #define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
19 #include <FrameworkDxe.h>
20 #include <IndustryStandard/SmBios.h>
21 #include <Protocol/Cpu.h>
22 #include <Protocol/Smbios.h>
23 #include <Protocol/FrameworkHii.h>
24 #include <Guid/DataHubRecords.h>
25 #include <Protocol/CpuIo2.h>
26 #include <Library/BaseLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/HiiLib.h>
29 #include <Library/UefiDriverEntryPoint.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/MemoryAllocationLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/EmuThunkLib.h>
36 extern UINT8 CpuStrings
[];
39 // Internal Data Structures
41 #define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')
47 EFI_CPU_ARCH_PROTOCOL Cpu
;
48 EFI_CPU_IO2_PROTOCOL CpuIo
;
51 // Local Data for CPU interface goes here
53 BOOLEAN InterruptState
;
55 } CPU_ARCH_PROTOCOL_PRIVATE
;
57 #define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \
59 CPU_ARCH_PROTOCOL_PRIVATE, \
61 CPU_ARCH_PROT_PRIVATE_SIGNATURE \
66 CpuMemoryServiceRead (
67 IN EFI_CPU_IO2_PROTOCOL
*This
,
68 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
76 CpuMemoryServiceWrite (
77 IN EFI_CPU_IO2_PROTOCOL
*This
,
78 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
87 IN EFI_CPU_IO2_PROTOCOL
*This
,
88 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
89 IN UINT64 UserAddress
,
91 IN OUT VOID
*UserBuffer
97 IN EFI_CPU_IO2_PROTOCOL
*This
,
98 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
99 IN UINT64 UserAddress
,
101 IN OUT VOID
*UserBuffer
107 IN EFI_HANDLE ImageHandle
,
108 IN EFI_SYSTEM_TABLE
*SystemTable
113 EmuFlushCpuDataCache (
114 IN EFI_CPU_ARCH_PROTOCOL
*This
,
115 IN EFI_PHYSICAL_ADDRESS Start
,
117 IN EFI_CPU_FLUSH_TYPE FlushType
123 IN EFI_CPU_ARCH_PROTOCOL
*This
128 EmuDisableInterrupt (
129 IN EFI_CPU_ARCH_PROTOCOL
*This
134 EmuGetInterruptState (
135 IN EFI_CPU_ARCH_PROTOCOL
*This
,
142 IN EFI_CPU_ARCH_PROTOCOL
*This
,
143 IN EFI_CPU_INIT_TYPE InitType
148 EmuRegisterInterruptHandler (
149 IN EFI_CPU_ARCH_PROTOCOL
*This
,
150 IN EFI_EXCEPTION_TYPE InterruptType
,
151 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
157 IN EFI_CPU_ARCH_PROTOCOL
*This
,
158 IN UINT32 TimerIndex
,
159 OUT UINT64
*TimerValue
,
160 OUT UINT64
*TimerPeriod OPTIONAL
165 EmuSetMemoryAttributes (
166 IN EFI_CPU_ARCH_PROTOCOL
*This
,
167 IN EFI_PHYSICAL_ADDRESS BaseAddress
,