return STATUS_SUCCESS;
}
-NTSTATUS
-MmSelectMappingAddress (
- _Out_ PVOID* MappingAddress,
- _In_ ULONGLONG Size,
- _In_ ULONG AllocationAttributes,
- _In_ ULONG Flags,
- _In_ PHYSICAL_ADDRESS PhysicalAddress
- )
-{
- /* Are we in physical mode? */
- if (MmTranslationType == BlNone)
- {
- /* Just return the physical address as the mapping address */
- *MappingAddress = (PVOID)PhysicalAddress.LowPart;
- return STATUS_SUCCESS;
- }
-
- /* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
- EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
- EfiStall(1000000);
-#endif
- return STATUS_NOT_IMPLEMENTED;
-}
-
-NTSTATUS
-MmMapPhysicalAddress (
- _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
- _Out_ PVOID VirtualAddress,
- _Inout_ PULONGLONG Size,
- _In_ ULONG CacheAttributes
- )
-{
- ULONGLONG MappingSize;
-
- /* Fail if any parameters are missing */
- if (!(PhysicalAddress) || !(VirtualAddress) || !(Size))
- {
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Fail if the size is over 32-bits */
- MappingSize = *Size;
- if (MappingSize > 0xFFFFFFFF)
- {
- return STATUS_INVALID_PARAMETER;
- }
-
- /* Nothing to do if we're in physical mode */
- if (MmTranslationType == BlNone)
- {
- return STATUS_SUCCESS;
- }
-
- /* Can't use virtual memory in real mode */
- if (CurrentExecutionContext->Mode == BlRealMode)
- {
- return STATUS_UNSUCCESSFUL;
- }
-
- /* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
- EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
- EfiStall(1000000);
-#endif
- return STATUS_NOT_IMPLEMENTED;
-}
-
NTSTATUS
BlMmMapPhysicalAddressEx (
_In_ PVOID* VirtualAddress,
/* Check for invalid requirement flag, if one is present */
if (((Flags & BlMemoryValidAllocationAttributes) != BlMemoryFixed) &&
- ((Flags & BlMemoryValidAllocationAttributes) != BlMemoryNonFixed) &&
+ ((Flags & BlMemoryValidAllocationAttributes) != BlMemoryKernelRange) &&
(Flags & BlMemoryValidAllocationAttributes))
{
Status = STATUS_INVALID_PARAMETER;
/* Select an address to map this at */
Status = MmSelectMappingAddress(&MappingAddress,
+ *VirtualAddress,
Size,
Flags & BlMemoryValidAllocationAttributes,
Flags,
MapSize = Size;
CacheAttributes = ((Flags & BlMemoryValidCacheAttributeMask) != 0x20) ?
(Flags & BlMemoryValidCacheAttributeMask) : 0;
+ EfiPrintf(L"Selected address: %p for %lx\r\n", MappingAddress, MappedAddress.LowPart);
Status = MmMapPhysicalAddress(&MappedAddress,
&MappingAddress,
&MapSize,
if (MmTranslationType != BlNone)
{
/* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
- EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
+ EfiPrintf(L"not yet implemented in %S\r\n", __FUNCTION__);
EfiStall(1000000);
-#endif
Status = STATUS_NOT_IMPLEMENTED;
goto Quickie;
}
else
{
/* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
- EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
+ EfiPrintf(L"not yet implemented in %S\r\n", __FUNCTION__);
EfiStall(1000000);
-#endif
Status = STATUS_NOT_IMPLEMENTED;
}
}
if ((NT_SUCCESS(Status)) && (MmTranslationType != BlNone))
{
/* We don't support virtual memory yet @TODO */
-#ifdef _MSC_VER // Fuck gcc.
- EfiPrintf(L"not yet implemented in " __FUNCTION__ "\r\n");
+ EfiPrintf(L"not yet implemented in %S\r\n", __FUNCTION__);
EfiStall(1000000);
-#endif
Status = STATUS_NOT_IMPLEMENTED;
}
}