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
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.
23 #include <Protocol/Cpu.h>
24 #include <Protocol/Legacy8259.h>
26 #include <Protocol/LegacyBios.h>
27 #include <Protocol/LegacyBiosThunk.h>
29 #include <Library/BaseLib.h>
30 #include <Library/DebugLib.h>
31 #include <Library/PrintLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
34 #define CPU_EXCEPTION_DEBUG_OUTPUT 1
35 #define CPU_EXCEPTION_VGA_SWITCH 0
37 #define INTERRUPT_VECTOR_NUMBER 0x100
42 //#define LEFT_JUSTIFY 0x01
43 #define PREFIX_SIGN 0x02
44 #define PREFIX_BLANK 0x04
45 //#define COMMA_TYPE 0x08
46 #define LONG_TYPE 0x10
47 //#define PREFIX_ZERO 0x20
48 #define OUTPUT_UNICODE 0x40
49 //#define RADIX_HEX 0x80
50 #define FORMAT_UNICODE 0x100
51 #define PAD_TO_WIDTH 0x200
52 #define ARGUMENT_UNICODE 0x400
53 #define PRECISION 0x800
54 #define ARGUMENT_REVERSED 0x1000
57 // Function declarations
62 IN EFI_HANDLE ImageHandle
,
63 IN EFI_SYSTEM_TABLE
*SystemTable
68 CpuFlushCpuDataCache (
69 IN EFI_CPU_ARCH_PROTOCOL
*This
,
70 IN EFI_PHYSICAL_ADDRESS Start
,
72 IN EFI_CPU_FLUSH_TYPE FlushType
78 IN EFI_CPU_ARCH_PROTOCOL
*This
84 IN EFI_CPU_ARCH_PROTOCOL
*This
89 CpuGetInterruptState (
90 IN EFI_CPU_ARCH_PROTOCOL
*This
,
97 IN EFI_CPU_ARCH_PROTOCOL
*This
,
98 IN EFI_CPU_INIT_TYPE InitType
103 CpuRegisterInterruptHandler (
104 IN EFI_CPU_ARCH_PROTOCOL
*This
,
105 IN EFI_EXCEPTION_TYPE InterruptType
,
106 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
112 IN EFI_CPU_ARCH_PROTOCOL
*This
,
113 IN UINT32 TimerIndex
,
114 OUT UINT64
*TimerValue
,
115 OUT UINT64
*TimerPeriod OPTIONAL
120 CpuSetMemoryAttributes(
121 IN EFI_CPU_ARCH_PROTOCOL
*This
,
122 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
128 InstallInterruptHandler (
130 VOID (*Handler
)(VOID
)
134 SystemExceptionHandler (