1 /* 2 * COPYRIGHT: See COPYING.ARM in the top level directory 3 * PROJECT: ReactOS UEFI Boot Manager 4 * FILE: boot/environ/lib/misc/rtlcompat.c 5 * PURPOSE: RTL Library Compatibility Routines 6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org) 7 */ 8 9 /* INCLUDES ******************************************************************/ 10 11 #include "bl.h" 12 13 /* FUNCTIONS *****************************************************************/ 14 15 #if DBG 16 VOID FASTCALL 17 CHECK_PAGED_CODE_RTL ( 18 char *file, 19 int line 20 ) 21 { 22 // boot-code is always ok 23 } 24 #endif 25 26 #ifdef _WIN64 27 PVOID MmHighestUserAddress = (PVOID)0xFFFFFFFFULL; // CHECKME 28 #else 29 PVOID MmHighestUserAddress = (PVOID)0xFFFFFFFF; 30 #endif 31 32 PVOID 33 NTAPI 34 RtlpAllocateMemory ( 35 _In_ ULONG Bytes, 36 _In_ ULONG Tag 37 ) 38 { 39 UNREFERENCED_PARAMETER(Tag); 40 return BlMmAllocateHeap(Bytes); 41 } 42 43 VOID 44 NTAPI 45 RtlpFreeMemory ( 46 _In_ PVOID Mem, 47 _In_ ULONG Tag 48 ) 49 { 50 UNREFERENCED_PARAMETER(Tag); 51 BlMmFreeHeap(Mem); 52 } 53 54 NTSTATUS 55 NTAPI 56 RtlpSafeCopyMemory ( 57 _Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, 58 _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, 59 _In_ SIZE_T Length 60 ) 61 { 62 RtlCopyMemory(Destination, Source, Length); 63 return STATUS_SUCCESS; 64 } 65 66 VOID 67 NTAPI 68 RtlAssert ( 69 IN PVOID FailedAssertion, 70 IN PVOID FileName, 71 IN ULONG LineNumber, 72 IN PCHAR Message OPTIONAL 73 ) 74 { 75 EfiPrintf(L"*** ASSERTION %s FAILED AT %d in %s (%s) ***\r\n", 76 FailedAssertion, 77 LineNumber, 78 FileName, 79 Message); 80 } 81 82 ULONG 83 DbgPrint ( 84 const char *Format, 85 ... 86 ) 87 { 88 EfiPrintf(L"%s\r\n", Format); 89 return 0; 90 } 91 92 VOID 93 NTAPI 94 KeBugCheckEx( 95 _In_ ULONG BugCheckCode, 96 _In_ ULONG_PTR BugCheckParameter1, 97 _In_ ULONG_PTR BugCheckParameter2, 98 _In_ ULONG_PTR BugCheckParameter3, 99 _In_ ULONG_PTR BugCheckParameter4) 100 { 101 __assume(0); 102 } 103