]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/CpuDxe/CpuDxe.h
017f49ec5c8e3577682363f21631589b806a746a
[mirror_edk2.git] / DuetPkg / CpuDxe / CpuDxe.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 CpuDxe.h
14
15 Abstract:
16
17 --*/
18 #ifndef _CPU_DXE_H
19 #define _CPU_DXE_H
20
21 #include <PiDxe.h>
22
23 #include <Protocol/Cpu.h>
24 #include <Protocol/Legacy8259.h>
25
26 #include <Protocol/LegacyBios.h>
27 #include <Protocol/LegacyBiosThunk.h>
28
29 #include <Library/BaseLib.h>
30 #include <Library/DebugLib.h>
31 #include <Library/PrintLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33
34 #define CPU_EXCEPTION_DEBUG_OUTPUT 1
35 #define CPU_EXCEPTION_VGA_SWITCH 0
36
37 #define INTERRUPT_VECTOR_NUMBER 0x100
38
39 //
40 // Print primitives
41 //
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
55
56 //
57 // Function declarations
58 //
59 EFI_STATUS
60 EFIAPI
61 InitializeCpu (
62 IN EFI_HANDLE ImageHandle,
63 IN EFI_SYSTEM_TABLE *SystemTable
64 );
65
66 EFI_STATUS
67 EFIAPI
68 CpuFlushCpuDataCache (
69 IN EFI_CPU_ARCH_PROTOCOL *This,
70 IN EFI_PHYSICAL_ADDRESS Start,
71 IN UINT64 Length,
72 IN EFI_CPU_FLUSH_TYPE FlushType
73 );
74
75 EFI_STATUS
76 EFIAPI
77 CpuEnableInterrupt (
78 IN EFI_CPU_ARCH_PROTOCOL *This
79 );
80
81 EFI_STATUS
82 EFIAPI
83 CpuDisableInterrupt (
84 IN EFI_CPU_ARCH_PROTOCOL *This
85 );
86
87 EFI_STATUS
88 EFIAPI
89 CpuGetInterruptState (
90 IN EFI_CPU_ARCH_PROTOCOL *This,
91 OUT BOOLEAN *State
92 );
93
94 EFI_STATUS
95 EFIAPI
96 CpuInit (
97 IN EFI_CPU_ARCH_PROTOCOL *This,
98 IN EFI_CPU_INIT_TYPE InitType
99 );
100
101 EFI_STATUS
102 EFIAPI
103 CpuRegisterInterruptHandler (
104 IN EFI_CPU_ARCH_PROTOCOL *This,
105 IN EFI_EXCEPTION_TYPE InterruptType,
106 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
107 );
108
109 EFI_STATUS
110 EFIAPI
111 CpuGetTimerValue (
112 IN EFI_CPU_ARCH_PROTOCOL *This,
113 IN UINT32 TimerIndex,
114 OUT UINT64 *TimerValue,
115 OUT UINT64 *TimerPeriod OPTIONAL
116 );
117
118 EFI_STATUS
119 EFIAPI
120 CpuSetMemoryAttributes(
121 IN EFI_CPU_ARCH_PROTOCOL *This,
122 IN EFI_PHYSICAL_ADDRESS BaseAddress,
123 IN UINT64 Length,
124 IN UINT64 Attributes
125 );
126
127 VOID
128 InstallInterruptHandler (
129 UINTN Vector,
130 VOID (*Handler)(VOID)
131 );
132
133 VOID
134 SystemExceptionHandler (
135 VOID
136 );
137
138 VOID
139 SystemTimerHandler (
140 VOID
141 );
142
143 VOID
144 InitDescriptor (
145 VOID
146 );
147
148 #endif