diff --git a/reactos/boot/freeldr/freeldr/CMakeLists.txt b/reactos/boot/freeldr/freeldr/CMakeLists.txt index f072a1a25dd..70a058fd7d8 100644 --- a/reactos/boot/freeldr/freeldr/CMakeLists.txt +++ b/reactos/boot/freeldr/freeldr/CMakeLists.txt @@ -243,11 +243,17 @@ endif() add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION loader NO_CAB FOR bootcd regtest) add_cd_file(TARGET freeldr FILE ${CMAKE_CURRENT_BINARY_DIR}/freeldr.sys DESTINATION loader NO_CAB NOT_IN_HYBRIDCD FOR livecd hybridcd NAME_ON_CD setupldr.sys) -concatenate_files( - ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys - ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin - ${_freeldr_pe_output_file}) +if(NOT ARCH STREQUAL "arm") + + concatenate_files( + ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys + ${CMAKE_CURRENT_BINARY_DIR}/frldr16.bin + ${_freeldr_pe_output_file}) + + add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys) +else() + add_custom_target(setupldr ALL DEPENDS ${_freeldr_pe_output_file}) +endif() -add_custom_target(setupldr ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys) add_cd_file(TARGET setupldr FILE ${CMAKE_CURRENT_BINARY_DIR}/setupldr.sys DESTINATION loader NO_CAB FOR bootcd regtest) diff --git a/reactos/dll/win32/dbghelp/cpu_arm.c b/reactos/dll/win32/dbghelp/cpu_arm.c index 31b1926877c..f58cf02543e 100644 --- a/reactos/dll/win32/dbghelp/cpu_arm.c +++ b/reactos/dll/win32/dbghelp/cpu_arm.c @@ -33,7 +33,7 @@ static BOOL arm_get_addr(HANDLE hThread, const CONTEXT* ctx, #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->Fpscr; return TRUE; #endif default: addr->Mode = -1; return FALSE; @@ -116,7 +116,7 @@ static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CON /* set frame information */ frame->AddrStack.Offset = context->Sp; frame->AddrReturn.Offset = context->Lr; - frame->AddrFrame.Offset = context->Fp; + frame->AddrFrame.Offset = context->Fpscr; frame->AddrPC.Offset = context->Pc; frame->Far = TRUE; @@ -169,8 +169,8 @@ static void* arm_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) 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->Fpscr); return &ctx->Fpscr; + //case CV_ARM_R0 + 12: *size = sizeof(ctx->Ip); return &ctx->Ip; case CV_ARM_SP: *size = sizeof(ctx->Sp); return &ctx->Sp; case CV_ARM_LR: *size = sizeof(ctx->Lr); return &ctx->Lr; diff --git a/reactos/dll/win32/kernel32/CMakeLists.txt b/reactos/dll/win32/kernel32/CMakeLists.txt index 711182a6685..16eb4cacbc5 100644 --- a/reactos/dll/win32/kernel32/CMakeLists.txt +++ b/reactos/dll/win32/kernel32/CMakeLists.txt @@ -90,6 +90,10 @@ elseif(ARCH STREQUAL "amd64") list(APPEND ASM_SOURCE client/amd64/fiber.S client/amd64/thread.S) +elseif(ARCH STREQUAL "arm") + list(APPEND ASM_SOURCE + client/arm/fiber.S + client/arm/thread.S) endif() add_asm_files(kernel32_asm ${ASM_SOURCE}) diff --git a/reactos/dll/win32/kernel32/client/except.c b/reactos/dll/win32/kernel32/client/except.c index 276f5f22031..53d962d5476 100644 --- a/reactos/dll/win32/kernel32/client/except.c +++ b/reactos/dll/win32/kernel32/client/except.c @@ -62,8 +62,14 @@ _dump_context(PCONTEXT pc) DbgPrint("R8: %I64x R9: %I64x R10: %I64x R11: %I64x\n", pc->R8, pc->R9, pc->R10, pc->R11); DbgPrint("R12: %I64x R13: %I64x R14: %I64x R15: %I64x\n", pc->R12, pc->R13, pc->R14, pc->R15); DbgPrint("EFLAGS: %.8x\n", pc->EFlags); +#elif defined(_M_ARM) + DbgPrint("PC: %08lx LR: %08lx SP: %08lx\n", pc->Pc); + DbgPrint("R0: %08lx R1: %08lx R2: %08lx R3: %08lx\n", pc->R0, pc->R1, pc->R2, pc->R3); + DbgPrint("R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n", pc->R4, pc->R5, pc->R6, pc->R7); + DbgPrint("R8: %08lx R9: %08lx R10: %08lx R11: %08lx\n", pc->R8, pc->R9, pc->R10, pc->R11); + DbgPrint("R12: %08lx CPSR: %08lx FPSCR: %08lx\n", pc->R12, pc->Cpsr, pc->R1, pc->Fpscr, pc->R3); #else -#warning Unknown architecture +#error "Unknown architecture" #endif } diff --git a/reactos/dll/win32/kernel32/client/utils.c b/reactos/dll/win32/kernel32/client/utils.c index f82437f8a66..8b39f5d0168 100644 --- a/reactos/dll/win32/kernel32/client/utils.c +++ b/reactos/dll/win32/kernel32/client/utils.c @@ -606,6 +606,33 @@ BaseInitializeContext(IN PCONTEXT Context, /* Give it some room for the Parameter */ Context->Rsp -= sizeof(PVOID); +#elif defined(_M_ARM) + DPRINT("BaseInitializeContext: %p\n", Context); + + // FIXME: check if this is correct! + /* Setup the Initial Win32 Thread Context */ + Context->R0 = (ULONG_PTR)StartAddress; + Context->R1 = (ULONG_PTR)Parameter; + Context->Sp = (ULONG_PTR)StackAddress; + + if (ContextType == 1) /* For Threads */ + { + Context->Pc = (ULONG_PTR)BaseThreadStartupThunk; + } + else if (ContextType == 2) /* For Fibers */ + { + Context->Pc = (ULONG_PTR)BaseFiberStartup; + } + else /* For first thread in a Process */ + { + Context->Pc = (ULONG_PTR)BaseProcessStartThunk; + } + + /* Set the Context Flags */ + Context->ContextFlags = CONTEXT_FULL; + + /* Give it some room for the Parameter */ + Context->Sp -= sizeof(PVOID); #else #warning Unknown architecture UNIMPLEMENTED; @@ -907,7 +934,7 @@ BasepCheckWinSaferRestrictions(IN HANDLE UserToken, OUT PHANDLE JobHandle) { NTSTATUS Status; - + /* Validate that there's a name */ if ((ApplicationName) && *(ApplicationName)) { diff --git a/reactos/drivers/crypto/ksecdd/ksecdd.h b/reactos/drivers/crypto/ksecdd/ksecdd.h index b9f571e40dc..c7761cbd12d 100644 --- a/reactos/drivers/crypto/ksecdd/ksecdd.h +++ b/reactos/drivers/crypto/ksecdd/ksecdd.h @@ -43,8 +43,13 @@ typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS ULONG64 Ctr0; ULONG64 Ctr1; } KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; +#elif defined(_M_ARM) +typedef struct _KSEC_MACHINE_SPECIFIC_COUNTERS +{ + ULONG Ccr; +} KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; #else -typedef ULONG KSEC_MACHINE_SPECIFIC_COUNTERS; +typedef ULONG KSEC_MACHINE_SPECIFIC_COUNTERS, *PKSEC_MACHINE_SPECIFIC_COUNTERS; #endif typedef struct _KSEC_ENTROPY_DATA diff --git a/reactos/drivers/crypto/ksecdd/random.c b/reactos/drivers/crypto/ksecdd/random.c index 0dc1b59cfce..cdcd2732079 100644 --- a/reactos/drivers/crypto/ksecdd/random.c +++ b/reactos/drivers/crypto/ksecdd/random.c @@ -76,6 +76,11 @@ KsecReadMachineSpecificCounters( MachineSpecificCounters->Pmc1 = __readpmc(1); } #endif +#elif defined(_M_ARM) +/* FIXME: this should go into a public header (from ksarm.h) */ +#define CP15_PMCCNTR 15, 0, 9, 13, 0 + /* Read the Cycle Counter Register */ + MachineSpecificCounters->Ccr = _MoveFromCoprocessor(CP15_PMCCNTR); #else #error Implement me! #endif diff --git a/reactos/hal/halarm/CMakeLists.txt b/reactos/hal/halarm/CMakeLists.txt index c04c8246b90..90ef16416b9 100644 --- a/reactos/hal/halarm/CMakeLists.txt +++ b/reactos/hal/halarm/CMakeLists.txt @@ -15,3 +15,5 @@ list(APPEND SOURCES add_library(hal SHARED ${SOURCES}) + +set_module_type(hal kerneldll ENTRYPOINT 0) diff --git a/reactos/win32ss/drivers/font/bmfd/bmfd.h b/reactos/win32ss/drivers/font/bmfd/bmfd.h index e117de802f4..58aedb268ee 100644 --- a/reactos/win32ss/drivers/font/bmfd/bmfd.h +++ b/reactos/win32ss/drivers/font/bmfd/bmfd.h @@ -19,8 +19,8 @@ #else // FIXME: BE #define GETVAL(x) \ - sizeof(x) == 1 ? (x) : \ - sizeof(x) == 2 ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \ + (sizeof(x) == 1) ? (x) : \ + (sizeof(x) == 2) ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \ (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8) + (((PCHAR)&(x))[2] << 16) + \ (((PCHAR)&(x))[3] << 24)) @@ -121,13 +121,13 @@ typedef struct _FONTDIRENTRY } FONTDIRENTRY, *PFONTDIRENTRY; typedef struct _DIRENTRY -{ +{ WORD fontOrdinal; FONTDIRENTRY fde; } DIRENTRY, *PDIRENTRY; typedef struct _FONTGROUPHDR -{ +{ WORD NumberOfFonts; DIRENTRY ade[1]; } FONTGROUPHDR, *PFONTGROUPHDR; diff --git a/reactos/win32ss/gdi/gdi32/wine/gdi_private.h b/reactos/win32ss/gdi/gdi32/wine/gdi_private.h index 5d9390e537e..710824d016b 100644 --- a/reactos/win32ss/gdi/gdi32/wine/gdi_private.h +++ b/reactos/win32ss/gdi/gdi32/wine/gdi_private.h @@ -138,8 +138,14 @@ extern void push_dc_driver_ros(PHYSDEV *dev, PHYSDEV physdev, const struct gdi_d BOOL WINAPI SetWorldTransformForMetafile(HDC hdc, const XFORM *pxform); #define SetWorldTransform SetWorldTransformForMetafile +#ifdef _M_ARM +#define DbgRaiseAssertionFailure() __emit(0xdefc) +#else +#define DbgRaiseAssertionFailure() __int2c() +#endif // _M_ARM + #undef ASSERT -#define ASSERT(x) if (!(x)) __int2c() +#define ASSERT(x) if (!(x)) DbgRaiseAssertionFailure() #endif /* __WINE_GDI_PRIVATE_H */ diff --git a/reactos/win32ss/gdi/gdi32/wine/rosglue.c b/reactos/win32ss/gdi/gdi32/wine/rosglue.c index 499b397f6cc..157977a1528 100644 --- a/reactos/win32ss/gdi/gdi32/wine/rosglue.c +++ b/reactos/win32ss/gdi/gdi32/wine/rosglue.c @@ -516,7 +516,7 @@ _assert ( const char *file, unsigned line) { - __int2c(); + DbgRaiseAssertionFailure(); } double