]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/CpuDxe/CpuDxe.h
c8cba816219499c0f224d9a24532198d2bc5f10a
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.h
1 /** @file
2
3 Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
4
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
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
32 #include <Guid/DebugImageInfoTable.h>
33 #include <Protocol/Cpu.h>
34 #include <Protocol/DebugSupport.h>
35 #include <Protocol/DebugSupportPeriodicCallback.h>
36 #include <Protocol/VirtualUncachedPages.h>
37 #include <Protocol/LoadedImage.h>
38
39
40 #define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \
41 EFI_MEMORY_WC | \
42 EFI_MEMORY_WT | \
43 EFI_MEMORY_WB | \
44 EFI_MEMORY_UCE \
45 )
46
47
48 /**
49 This function registers and enables the handler specified by InterruptHandler for a processor
50 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
51 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
52 The installed handler is called once for each processor interrupt or exception.
53
54 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
55 are enabled and FALSE if interrupts are disabled.
56 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
57 when a processor interrupt occurs. If this parameter is NULL, then the handler
58 will be uninstalled.
59
60 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
61 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
62 previously installed.
63 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
64 previously installed.
65 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
66
67 **/
68 EFI_STATUS
69 RegisterInterruptHandler (
70 IN EFI_EXCEPTION_TYPE InterruptType,
71 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
72 );
73
74
75 /**
76 This function registers and enables the handler specified by InterruptHandler for a processor
77 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
78 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
79 The installed handler is called once for each processor interrupt or exception.
80
81 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
82 are enabled and FALSE if interrupts are disabled.
83 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
84 when a processor interrupt occurs. If this parameter is NULL, then the handler
85 will be uninstalled.
86
87 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
88 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
89 previously installed.
90 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
91 previously installed.
92 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
93
94 **/
95 EFI_STATUS
96 RegisterDebuggerInterruptHandler (
97 IN EFI_EXCEPTION_TYPE InterruptType,
98 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
99 );
100
101
102 EFI_STATUS
103 EFIAPI
104 CpuSetMemoryAttributes (
105 IN EFI_CPU_ARCH_PROTOCOL *This,
106 IN EFI_PHYSICAL_ADDRESS BaseAddress,
107 IN UINT64 Length,
108 IN UINT64 Attributes
109 );
110
111 EFI_STATUS
112 InitializeExceptions (
113 IN EFI_CPU_ARCH_PROTOCOL *Cpu
114 );
115
116 EFI_STATUS
117 SyncCacheConfig (
118 IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
119 );
120
121 EFI_STATUS
122 ConvertSectionToPages (
123 IN EFI_PHYSICAL_ADDRESS BaseAddress
124 );
125
126
127 extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;
128
129 #endif // __CPU_DXE_ARM_EXCEPTION_H__