[BOOT:LIB] More initialization and cleanup
Started BlpMmDestroy(), MmMdDestroy(), MmPaDestroy(), EfiSetWatchdogTimer(), EfiOpenProtocol(), EfiConInExSetState(), and BlDestroyLibrary(). Completed BlpFwInitialize(). Improved InitializeLibrary().
This commit is contained in:
@@ -17,6 +17,56 @@ Abstract:
|
||||
#include "bootlib.h"
|
||||
#include "mm.h"
|
||||
|
||||
ULONG MmTranslationType;
|
||||
|
||||
NTSTATUS
|
||||
BlpMmDestroy (
|
||||
IN ULONG Stage
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Cleans up after any actions performed by the memory manager.
|
||||
After calling this, the memory manager can no longer be used.
|
||||
|
||||
Arguments:
|
||||
|
||||
Stage - Which stage of cleanup to perform.
|
||||
Stage 0: Unknown.
|
||||
Stage 1: Destroy all MM modules.
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS if successful.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
NTSTATUS Status, ExitStatus;
|
||||
|
||||
ExitStatus = STATUS_SUCCESS;
|
||||
if (Stage == 1) {
|
||||
Status = MmMdDestroy();
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
ExitStatus = Status;
|
||||
}
|
||||
|
||||
Status = MmPaDestroy(0);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
ExitStatus = Status;
|
||||
}
|
||||
|
||||
Status = MmPaDestroy(1);
|
||||
if (!NT_SUCCESS(Status)) {
|
||||
ExitStatus = Status;
|
||||
}
|
||||
}
|
||||
|
||||
return ExitStatus;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
BlpMmInitializeConstraints (
|
||||
VOID
|
||||
@@ -34,8 +84,7 @@ Arguments:
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS if successful,
|
||||
|
||||
STATUS_SUCCESS if successful.
|
||||
|
||||
--*/
|
||||
|
||||
@@ -83,8 +132,8 @@ Return Value:
|
||||
// Check TranslationType.
|
||||
//
|
||||
if (
|
||||
TranslationType > TRANSLATION_TYPE_MAX ||
|
||||
LibraryParameters->TranslationType > TRANSLATION_TYPE_MAX
|
||||
TranslationType > TRANSLATION_TYPE_MAX
|
||||
|| LibraryParameters->TranslationType > TRANSLATION_TYPE_MAX
|
||||
) {
|
||||
DebugPrint(L"BlpMmInitialize(): TranslationType is invalid\r\n");
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
@@ -103,6 +152,8 @@ Return Value:
|
||||
return Status;
|
||||
}
|
||||
|
||||
MmTranslationType = LibraryParameters->TranslationType;
|
||||
|
||||
//
|
||||
// TODO: Finish this routine.
|
||||
//
|
||||
|
@@ -885,6 +885,35 @@ Return Value:
|
||||
return Descriptor;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
MmMdDestroy (
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Cleans up after any actions performed by the memory descriptor manager.
|
||||
After calling this, the memory descriptor manager can no longer be used.
|
||||
|
||||
Arguments:
|
||||
|
||||
None.
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
//
|
||||
// TODO: Implement this routine.
|
||||
//
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
MmMdInitialize (
|
||||
IN ULONG Stage,
|
||||
|
@@ -58,6 +58,40 @@ Return Value:
|
||||
Mdl->Type = MDL_TYPE_PHYSICAL;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
MmPaDestroy (
|
||||
IN ULONG Stage
|
||||
)
|
||||
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Cleans up after any actions performed by the page allocator.
|
||||
After calling this, the page allocator can no longer be used.
|
||||
|
||||
Arguments:
|
||||
|
||||
Stage - Which stage of cleanup to perform.
|
||||
Stage 0: Unknown.
|
||||
Stage 1: Unknown.
|
||||
|
||||
Return Value:
|
||||
|
||||
STATUS_SUCCESS.
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
(VOID)Stage;
|
||||
|
||||
//
|
||||
// TODO: Implement this routine.
|
||||
//
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
MmPaInitialize (
|
||||
IN PBOOT_MEMORY_INFO MemoryInfo,
|
||||
|
Reference in New Issue
Block a user