mirror of https://github.com/acidanthera/audk.git
Make these drivers more compatible with a projected Debug Agent Library implementation.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10196 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d03171efd1
commit
41d478023f
|
@ -180,6 +180,7 @@ InitializeExceptions (
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
BOOLEAN Enabled;
|
BOOLEAN Enabled;
|
||||||
EFI_PHYSICAL_ADDRESS Base;
|
EFI_PHYSICAL_ADDRESS Base;
|
||||||
|
UINT32 *VectorBase;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Disable interrupts
|
// Disable interrupts
|
||||||
|
@ -187,16 +188,6 @@ InitializeExceptions (
|
||||||
Cpu->GetInterruptState (Cpu, &Enabled);
|
Cpu->GetInterruptState (Cpu, &Enabled);
|
||||||
Cpu->DisableInterrupt (Cpu);
|
Cpu->DisableInterrupt (Cpu);
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize the C entry points for interrupts
|
|
||||||
//
|
|
||||||
for (Index = 0; Index <= MAX_ARM_EXCEPTION; Index++) {
|
|
||||||
Status = RegisterInterruptHandler (Index, NULL);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
Status = RegisterDebuggerInterruptHandler (Index, NULL);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Copy an implementation of the ARM exception vectors to PcdCpuVectorBaseAddress.
|
// Copy an implementation of the ARM exception vectors to PcdCpuVectorBaseAddress.
|
||||||
|
@ -207,6 +198,7 @@ InitializeExceptions (
|
||||||
// Reserve space for the exception handlers
|
// Reserve space for the exception handlers
|
||||||
//
|
//
|
||||||
Base = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdCpuVectorBaseAddress);
|
Base = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdCpuVectorBaseAddress);
|
||||||
|
VectorBase = (UINT32 *)(UINTN)Base;
|
||||||
Status = gBS->AllocatePages (AllocateAddress, EfiBootServicesCode, EFI_SIZE_TO_PAGES (Length), &Base);
|
Status = gBS->AllocatePages (AllocateAddress, EfiBootServicesCode, EFI_SIZE_TO_PAGES (Length), &Base);
|
||||||
// If the request was for memory that's not in the memory map (which is often the case for 0x00000000
|
// If the request was for memory that's not in the memory map (which is often the case for 0x00000000
|
||||||
// on embedded systems, for example, we don't want to hang up. So we'll check here for a status of
|
// on embedded systems, for example, we don't want to hang up. So we'll check here for a status of
|
||||||
|
@ -215,7 +207,25 @@ InitializeExceptions (
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyMem ((VOID *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress), (VOID *)ExceptionHandlersStart, Length);
|
// Save existing vector table, in case debugger is already hooked in
|
||||||
|
CopyMem ((VOID *)gDebuggerExceptionHandlers, (VOID *)VectorBase, sizeof (gDebuggerExceptionHandlers));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize the C entry points for interrupts
|
||||||
|
//
|
||||||
|
for (Index = 0; Index <= MAX_ARM_EXCEPTION; Index++) {
|
||||||
|
Status = RegisterInterruptHandler (Index, NULL);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
if (VectorBase[Index] == 0xEAFFFFFE) {
|
||||||
|
// Exception handler contains branch to vector location (jmp $) so no handler
|
||||||
|
// NOTE: This code assumes vectors are ARM and not Thumb code
|
||||||
|
gDebuggerExceptionHandlers[Index] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy our assembly code into the page that contains the exception vectors.
|
||||||
|
CopyMem ((VOID *)VectorBase, (VOID *)ExceptionHandlersStart, Length);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Patch in the common Assembly exception handler
|
// Patch in the common Assembly exception handler
|
||||||
|
|
|
@ -345,7 +345,7 @@ InterruptDxeInitialize (
|
||||||
MmioWrite32 (INTCPS_MIR(0), 0xFFFFFFFF);
|
MmioWrite32 (INTCPS_MIR(0), 0xFFFFFFFF);
|
||||||
MmioWrite32 (INTCPS_MIR(1), 0xFFFFFFFF);
|
MmioWrite32 (INTCPS_MIR(1), 0xFFFFFFFF);
|
||||||
MmioWrite32 (INTCPS_MIR(2), 0xFFFFFFFF);
|
MmioWrite32 (INTCPS_MIR(2), 0xFFFFFFFF);
|
||||||
MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
|
MmioOr32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
|
||||||
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces(&gHardwareInterruptHandle,
|
Status = gBS->InstallMultipleProtocolInterfaces(&gHardwareInterruptHandle,
|
||||||
&gHardwareInterruptProtocolGuid, &gHardwareInterruptProtocol,
|
&gHardwareInterruptProtocolGuid, &gHardwareInterruptProtocol,
|
||||||
|
|
Loading…
Reference in New Issue