4 Copyright (c) 2008 - 2009, Intel Corporation
5 All rights reserved. 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.
20 #include <Protocol/Cpu.h>
22 #include <Library/UefiDriverEntryPoint.h>
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/DxeServicesTableLib.h>
25 #include <Library/BaseLib.h>
26 #include <Library/CpuLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/DebugLib.h>
30 #include <Library/MtrrLib.h>
35 #define INTERRUPT_VECTOR_NUMBER 256
37 #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \
46 // Function declarations
50 CpuFlushCpuDataCache (
51 IN EFI_CPU_ARCH_PROTOCOL
*This
,
52 IN EFI_PHYSICAL_ADDRESS Start
,
54 IN EFI_CPU_FLUSH_TYPE FlushType
60 IN EFI_CPU_ARCH_PROTOCOL
*This
66 IN EFI_CPU_ARCH_PROTOCOL
*This
71 CpuGetInterruptState (
72 IN EFI_CPU_ARCH_PROTOCOL
*This
,
79 IN EFI_CPU_ARCH_PROTOCOL
*This
,
80 IN EFI_CPU_INIT_TYPE InitType
85 CpuRegisterInterruptHandler (
86 IN EFI_CPU_ARCH_PROTOCOL
*This
,
87 IN EFI_EXCEPTION_TYPE InterruptType
,
88 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
94 IN EFI_CPU_ARCH_PROTOCOL
*This
,
96 OUT UINT64
*TimerValue
,
97 OUT UINT64
*TimerPeriod OPTIONAL
102 CpuSetMemoryAttributes (
103 IN EFI_CPU_ARCH_PROTOCOL
*This
,
104 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
117 InitializeExternalVectorTablePtr (
118 EFI_CPU_INTERRUPT_HANDLER
*VectorTable
122 InitGlobalDescriptorTable (