]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Drivers/CpuDxe/CpuDxe.h
Cleanup to match MdePkg cleanups. More progress on ARM disassembler.
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.h
CommitLineData
2ef2b01e
A
1/** @file\r
2\r
3 Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
4\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __CPU_DXE_ARM_EXCEPTION_H__\r
16#define __CPU_DXE_ARM_EXCEPTION_H__\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Library/ArmLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
2ef2b01e
A
22#include <Library/DebugLib.h>\r
23#include <Library/PcdLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
f659880b
A
25#include <Library/DxeServicesTableLib.h>\r
26#include <Library/CacheMaintenanceLib.h>\r
27#include <Library/PeCoffGetEntryPointLib.h>\r
28#include <Library/UefiLib.h>\r
29#include <Library/CpuLib.h>\r
6f72e28d 30#include <Library/DefaultExceptionHandlerLib.h>\r
eeb78924 31#include <Library/DebugLib.h>\r
2ef2b01e 32\r
f659880b 33#include <Guid/DebugImageInfoTable.h>\r
2ef2b01e
A
34#include <Protocol/Cpu.h>\r
35#include <Protocol/DebugSupport.h>\r
36#include <Protocol/DebugSupportPeriodicCallback.h>\r
f659880b
A
37#include <Protocol/VirtualUncachedPages.h>\r
38#include <Protocol/LoadedImage.h>\r
39\r
40\r
41#define EFI_MEMORY_CACHETYPE_MASK (EFI_MEMORY_UC | \\r
42 EFI_MEMORY_WC | \\r
43 EFI_MEMORY_WT | \\r
44 EFI_MEMORY_WB | \\r
45 EFI_MEMORY_UCE \\r
46 )\r
2ef2b01e
A
47\r
48\r
49/**\r
50 This function registers and enables the handler specified by InterruptHandler for a processor \r
51 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
52 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
53 The installed handler is called once for each processor interrupt or exception.\r
54\r
55 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
56 are enabled and FALSE if interrupts are disabled.\r
57 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
58 when a processor interrupt occurs. If this parameter is NULL, then the handler\r
59 will be uninstalled.\r
60\r
61 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
62 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
63 previously installed.\r
64 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
65 previously installed.\r
66 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r
67\r
68**/\r
69EFI_STATUS\r
70RegisterInterruptHandler (\r
71 IN EFI_EXCEPTION_TYPE InterruptType,\r
72 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
73 );\r
74\r
75\r
76/**\r
77 This function registers and enables the handler specified by InterruptHandler for a processor \r
78 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
79 handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
80 The installed handler is called once for each processor interrupt or exception.\r
81\r
82 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
83 are enabled and FALSE if interrupts are disabled.\r
84 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
85 when a processor interrupt occurs. If this parameter is NULL, then the handler\r
86 will be uninstalled.\r
87\r
88 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
89 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
90 previously installed.\r
91 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
92 previously installed.\r
93 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r
94\r
95**/\r
96EFI_STATUS\r
97RegisterDebuggerInterruptHandler (\r
98 IN EFI_EXCEPTION_TYPE InterruptType,\r
99 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler\r
100 );\r
101\r
102\r
f659880b
A
103EFI_STATUS\r
104EFIAPI\r
105CpuSetMemoryAttributes (\r
106 IN EFI_CPU_ARCH_PROTOCOL *This,\r
107 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
108 IN UINT64 Length,\r
109 IN UINT64 Attributes\r
110 );\r
111\r
2ef2b01e
A
112EFI_STATUS\r
113InitializeExceptions (\r
114 IN EFI_CPU_ARCH_PROTOCOL *Cpu\r
115 );\r
116\r
f659880b
A
117EFI_STATUS\r
118SyncCacheConfig (\r
119 IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r
120 );\r
121\r
122EFI_STATUS \r
123ConvertSectionToPages (\r
124 IN EFI_PHYSICAL_ADDRESS BaseAddress\r
125 );\r
126\r
127\r
128extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;\r
129\r
2ef2b01e 130#endif // __CPU_DXE_ARM_EXCEPTION_H__\r