set_target_properties(bootmgfw PROPERTIES SUFFIX ".efi")
if(MSVC)
- add_target_link_flags(bootmgfw "/ignore:4078 /ignore:4254 /DRIVER /FIXED")
+ if (ARCH STREQUAL "arm")
+ add_target_link_flags(bootmgfw "/ignore:4078 /ignore:4254 /DRIVER")
+ else()
+ add_target_link_flags(bootmgfw "/ignore:4078 /ignore:4254 /DRIVER /FIXED")
+ endif()
else()
add_target_link_flags(bootmgfw "-Wl,--strip-all,--exclude-all-symbols")
endif()
RebootOnError = FALSE;
/* Save the start/end-of-POST time */
+#if defined(_M_IX86) || defined(_M_X64)
ApplicationStartTime = __rdtsc();
+#else
+ EfiPrintf(L"No time source defined for this platform\r\n");
+ ApplicationStartTime = 0;
+#endif
PostTime = ApplicationStartTime;
/* Setup the boot library parameters for this application */
ULONG IapTableEntries;
PVOID* IapImageTable;
+#ifndef _M_ARM
KDESCRIPTOR GdtRegister;
KDESCRIPTOR IdtRegister;
KDESCRIPTOR BootAppGdtRegister;
PVOID BootApp32EntryRoutine;
PBOOT_APPLICATION_PARAMETER_BLOCK BootApp32Parameters;
PVOID BootApp32Stack;
+#endif
/* FUNCTIONS *****************************************************************/
_In_ PBL_RETURN_ARGUMENTS ReturnArguments
)
{
+#ifndef _M_ARM
KDESCRIPTOR Gdt, Idt;
ULONG BootSizeNeeded;
NTSTATUS Status;
/* Free it */
MmPapFreePages(BootData, BL_MM_INCLUDE_MAPPED_ALLOCATED);
}
+#else
+ EfiPrintf(L"ImgArchEfiStartBootApplication not implemented for this platform.\r\n");
+#endif
/* All done */
return STATUS_NOT_IMPLEMENTED;
return PartialSum;
}
+#if defined(_M_IX86) || defined(_M_X64)
BOOLEAN
Archx86IsCpuidSupported (
VOID
/* Check if the bit stuck */
return (((CallerFlags ^ Flags) >> 21) & 1) ^ 1;
}
+#endif
BOOLEAN
BlArchIsCpuIdFunctionSupported (
_In_ ULONG Function
)
{
+#if defined(_M_IX86) || defined(_M_X64)
BOOLEAN Supported;
INT CpuInfo[4];
{
return TRUE;
}
+#else
+ EfiPrintf(L"BlArchIsCpuIdFunctionSupported not implemented for this platform.\r\n");
+#endif
/* Nope */
return FALSE;
VOID
)
{
+#if defined(_M_IX86) || defined(_M_X64)
INT CpuInfo[4];
/* Serialize with CPUID, if it exists */
/* Read the TSC */
return __rdtsc();
+#else
+ EfiPrintf(L"BlArchGetPerformanceCounter not implemented for this platform.\r\n");
+ return 0;
+#endif
}
VOID
_Out_ INT* Result
)
{
+#if defined(_M_IX86) || defined(_M_X64)
/* Use the intrinsic */
__cpuidex(Result, Function, SubFunction);
+#endif
}
VOID
)
{
+#if defined(_M_IX86) || defined(_M_X64)
ULONG Count;
INT CpuInfo[4];
ULONGLONG TimeStamp1, TimeStamp2, Delta;
/* Set the frequency based on the two measurements we took */
BlpTimePerformanceFrequency = 125 * (Delta - (TimeStamp2 - TimeStamp1)) & 0x1FFFFFFFFFFFFFF;
return STATUS_SUCCESS;
+#else
+ EfiPrintf(L"BlpTimeMeasureTscFrequency not implemented for this platform.\r\n");
+ return STATUS_NOT_IMPLEMENTED;
+#endif
}
NTSTATUS
VOID
)
{
+#if defined(_M_IX86) || defined(_M_X64)
INT CpuInfo[4];
/* Check if the ISVM bit it set, meaning we're in a hypervisor */
/* On other systems, compute it */
return BlpTimeMeasureTscFrequency();
+#else
+ EfiPrintf(L"BlpTimeCalibratePerformanceCounter not implemented for this platform.\r\n");
+ return STATUS_NOT_IMPLEMENTED;
+#endif
}
ULONGLONG
_Out_opt_ PLARGE_INTEGER Frequency
)
{
+#if defined(_M_IX86) || defined(_M_X64)
/* Check if caller wants frequency */
if (Frequency)
{
/* Return the TSC value */
return __rdtsc();
+#else
+ EfiPrintf(L"BlTimeQueryPerformanceCounter not implemented for this platform.\r\n");
+ return 0;
+#endif
};
#elif defined(_M_PPC)
__asm__("mr %0,1" : "=r" (Stack) : );
#elif defined(_M_ARM)
+#if defined __GNUC__
__asm__("mov sp, %0" : "=r"(Stack) : );
+#elif defined(_MSC_VER)
+ // FIXME: Hack. Probably won't work if this ever actually manages to run someday.
+ Stack = (ULONG_PTR)&Stack;
+#endif
#else
#error Unknown architecture
#endif
#ifdef __arm__
case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE;
case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE;
- case cpu_addr_frame: addr->Offset = ctx->Fp; return TRUE;
+ case cpu_addr_frame: addr->Offset = ctx->R11; return TRUE;
#endif
default: addr->Mode = -1;
return FALSE;
/* set frame information */
frame->AddrStack.Offset = context->Sp;
frame->AddrReturn.Offset = context->Lr;
- frame->AddrFrame.Offset = context->Fp;
+ frame->AddrFrame.Offset = context->R11;
frame->AddrPC.Offset = context->Pc;
frame->Far = TRUE;
case CV_ARM_R0 + 8: *size = sizeof(ctx->R8); return &ctx->R8;
case CV_ARM_R0 + 9: *size = sizeof(ctx->R9); return &ctx->R9;
case CV_ARM_R0 + 10: *size = sizeof(ctx->R10); return &ctx->R10;
- case CV_ARM_R0 + 11: *size = sizeof(ctx->Fp); return &ctx->Fp;
- case CV_ARM_R0 + 12: *size = sizeof(ctx->Ip); return &ctx->Ip;
+ case CV_ARM_R0 + 11: *size = sizeof(ctx->R11); return &ctx->R11;
+ case CV_ARM_R0 + 12: *size = sizeof(ctx->R12); return &ctx->R12;
case CV_ARM_SP: *size = sizeof(ctx->Sp); return &ctx->Sp;
case CV_ARM_LR: *size = sizeof(ctx->Lr); return &ctx->Lr;
@ cdecl -arch=arm ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z() MSVCRT__set_new_handler # int (__cdecl*__cdecl _set_new_handler(int (__cdecl*)(unsigned int)))(unsigned int)
@ cdecl -arch=arm ?_set_new_mode@@YAHH@Z() MSVCRT__set_new_mode # int __cdecl _set_new_mode(int)
@ cdecl -arch=arm ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z() MSVCRT__set_se_translator # void (__cdecl*__cdecl _set_se_translator(void (__cdecl*)(unsigned int,struct _EXCEPTION_POINTERS *)))(unsigned int,struct _EXCEPTION_POINTERS *)
-@ cdecl -arch=arm ?before@type_info@@QBAHABV1@@Z() MSVCRT_type_info_before# public: int __cdecl type_info::before(class type_info const &)const
+@ cdecl -arch=arm ?before@type_info@@QBAHABV1@@Z() MSVCRT_type_info_before # public: int __cdecl type_info::before(class type_info const &)const
@ cdecl -arch=arm ?name@type_info@@QBAPBDXZ() MSVCRT_type_info_name # public: char const * __cdecl type_info::name(void)const
@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ() MSVCRT_type_info_raw_name # public: char const * __cdecl type_info::raw_name(void)const
@ cdecl -arch=arm ?set_terminate@@YAP6AXXZP6AXXZ@Z() MSVCRT_set_terminate # void (__cdecl*__cdecl set_terminate(void (__cdecl*)(void)))(void)
#include <stdio.h>
#include <stdarg.h>
#include <stddef.h>
+#ifndef __REACTOS__
+// Not actually used
#include <emmintrin.h>
+#endif /* __REACTOS__ */
#include "btrfs.h"
#include "btrfsioctl.h"
add_asm_files(ntdllsys_asm ntdll.S)
add_library(ntdllsys ${ntdllsys_asm})
set_target_properties(ntdllsys PROPERTIES LINKER_LANGUAGE "C")
+add_dependencies(ntdllsys asm)
\ No newline at end of file
; void __cdecl operator delete[](void *,struct std::nothrow_t const &)
DEFINE_ALIAS ??_V@YAXPAXABUnothrow_t@std@@@Z, ??3@YAXPAX@Z
+ ; void __cdecl operator delete(void *,unsigned int)
+ DEFINE_ALIAS ??3@YAXPAXI@Z, ??3@YAXPAX@Z
+
END
#elif defined (_M_IA64) || defined (_M_AMD64)
#pragma comment(linker, "/alternatename:__pfnDliNotifyHook2=__pfnDliNotifyHook2Default")
#pragma comment(linker, "/alternatename:__pfnDliFailureHook2=__pfnDliFailureHook2Default")
+#elif defined (_M_ARM)
+#pragma comment(linker, "/alternatename:__pfnDliNotifyHook2=__pfnDliNotifyHook2Default")
+#pragma comment(linker, "/alternatename:__pfnDliFailureHook2=__pfnDliFailureHook2Default")
#else
#error Unsupported platform, please find the correct decoration for your arch!
#endif
add_asm_files(win32ksys_asm sys-stubs.S)
add_library(win32ksys ${win32ksys_asm})
set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C")
+add_dependencies(win32ksys asm)
\ No newline at end of file