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