]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/CpuDxe/CpuDxe.h
ArmPkg: Create MpCoreInfo PPI and HOB to describe CPU Cores on a MPCore platform
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.h
1 /** @file
2
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4
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
9
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.
12
13 **/
14
15 #ifndef __CPU_DXE_ARM_EXCEPTION_H__
16 #define __CPU_DXE_ARM_EXCEPTION_H__
17
18 #include <Uefi.h>
19
20 #include <Library/ArmLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/PcdLib.h>
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/DxeServicesTableLib.h>
26 #include <Library/CacheMaintenanceLib.h>
27 #include <Library/PeCoffGetEntryPointLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/CpuLib.h>
30 #include <Library/DefaultExceptionHandlerLib.h>
31 #include <Library/DebugLib.h>
32
33 #include <Guid/DebugImageInfoTable.h>
34 #include <Protocol/Cpu.h>
35 #include <Protocol/DebugSupport.h>
36 #include <Protocol/DebugSupportPeriodicCallback.h>
37 #include <Protocol/VirtualUncachedPages.h>
38 #include <Protocol/LoadedImage.h>
39
40
41 #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \
42 EFI_MEMORY_WC | \
43 EFI_MEMORY_WT | \
44 EFI_MEMORY_WB | \
45 EFI_MEMORY_UCE \
46 )
47
48
49 /**
50 This function registers and enables the handler specified by InterruptHandler for a processor
51 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
52 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
53 The installed handler is called once for each processor interrupt or exception.
54
55 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
56 are enabled and FALSE if interrupts are disabled.
57 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
58 when a processor interrupt occurs. If this parameter is NULL, then the handler
59 will be uninstalled.
60
61 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
62 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
63 previously installed.
64 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
65 previously installed.
66 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
67
68 **/
69 EFI_STATUS
70 RegisterInterruptHandler (
71 IN EFI_EXCEPTION_TYPE InterruptType,
72 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
73 );
74
75
76 /**
77 This function registers and enables the handler specified by InterruptHandler for a processor
78 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
79 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
80 The installed handler is called once for each processor interrupt or exception.
81
82 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
83 are enabled and FALSE if interrupts are disabled.
84 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
85 when a processor interrupt occurs. If this parameter is NULL, then the handler
86 will be uninstalled.
87
88 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
89 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
90 previously installed.
91 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
92 previously installed.
93 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
94
95 **/
96 EFI_STATUS
97 RegisterDebuggerInterruptHandler (
98 IN EFI_EXCEPTION_TYPE InterruptType,
99 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
100 );
101
102
103 EFI_STATUS
104 EFIAPI
105 CpuSetMemoryAttributes (
106 IN EFI_CPU_ARCH_PROTOCOL *This,
107 IN EFI_PHYSICAL_ADDRESS BaseAddress,
108 IN UINT64 Length,
109 IN UINT64 Attributes
110 );
111
112 EFI_STATUS
113 InitializeExceptions (
114 IN EFI_CPU_ARCH_PROTOCOL *Cpu
115 );
116
117 EFI_STATUS
118 SyncCacheConfig (
119 IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
120 );
121
122 EFI_STATUS
123 ConvertSectionToPages (
124 IN EFI_PHYSICAL_ADDRESS BaseAddress
125 );
126
127 /**
128 * Publish ARM Processor Data table in UEFI SYSTEM Table.
129 * @param HobStart Pointer to the beginning of the HOB List from PEI.
130 *
131 * Description : This function iterates through HOB list and finds ARM processor Table Entry HOB.
132 * If the ARM processor Table Entry HOB is found, the HOB data is copied to run-time memory
133 * and a pointer is assigned to it in ARM processor table. Then the ARM processor table is
134 * installed in EFI configuration table.
135 **/
136 VOID
137 EFIAPI
138 PublishArmProcessorTable(
139 VOID
140 );
141
142 extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;
143
144 #endif // __CPU_DXE_ARM_EXCEPTION_H__