]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/CpuDxe/CpuDxe.h
Fixed a bug in the HardwareInterrupt handler that would blow the stack if you reenabl...
[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/CacheMaintenanceLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/PcdLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26
27 #include <Protocol/Cpu.h>
28 #include <Protocol/DebugSupport.h>
29 #include <Protocol/DebugSupportPeriodicCallback.h>
30
31
32 /**
33 This function registers and enables the handler specified by InterruptHandler for a processor
34 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
35 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
36 The installed handler is called once for each processor interrupt or exception.
37
38 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
39 are enabled and FALSE if interrupts are disabled.
40 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
41 when a processor interrupt occurs. If this parameter is NULL, then the handler
42 will be uninstalled.
43
44 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
45 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
46 previously installed.
47 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
48 previously installed.
49 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
50
51 **/
52 EFI_STATUS
53 RegisterInterruptHandler (
54 IN EFI_EXCEPTION_TYPE InterruptType,
55 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
56 );
57
58
59 /**
60 This function registers and enables the handler specified by InterruptHandler for a processor
61 interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
62 handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
63 The installed handler is called once for each processor interrupt or exception.
64
65 @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
66 are enabled and FALSE if interrupts are disabled.
67 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
68 when a processor interrupt occurs. If this parameter is NULL, then the handler
69 will be uninstalled.
70
71 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
72 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
73 previously installed.
74 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
75 previously installed.
76 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
77
78 **/
79 EFI_STATUS
80 RegisterDebuggerInterruptHandler (
81 IN EFI_EXCEPTION_TYPE InterruptType,
82 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
83 );
84
85
86 EFI_STATUS
87 InitializeExceptions (
88 IN EFI_CPU_ARCH_PROTOCOL *Cpu
89 );
90
91 #endif // __CPU_DXE_ARM_EXCEPTION_H__