From 70ff0e774d82ef6616a9245c7c89e798204cd480 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 10 May 2015 21:04:27 +0000 Subject: [PATCH] [CRT/RTL/NTOSKRNL] Add new ARM files to build and improve the stubs a bit svn path=/trunk/; revision=67641 --- reactos/lib/rtl/CMakeLists.txt | 1 + reactos/lib/sdk/crt/crt.cmake | 35 ++++++++++++++++++- .../lib/sdk/crt/except/arm/__jump_unwind.s | 8 ++--- .../crt/except/arm/_abnormal_termination.s | 7 ++-- .../lib/sdk/crt/except/arm/_except_handler2.s | 7 ++-- .../lib/sdk/crt/except/arm/_except_handler3.s | 7 ++-- .../lib/sdk/crt/except/arm/_global_unwind2.s | 7 ++-- .../lib/sdk/crt/except/arm/_local_unwind2.s | 7 ++-- reactos/lib/sdk/crt/except/arm/chkstk_asm.s | 11 +++--- reactos/lib/sdk/crt/except/arm/chkstk_ms.s | 11 +++--- reactos/lib/sdk/crt/libcntpr.cmake | 31 ++++++++++++++++ reactos/lib/sdk/crt/math/arm/floor.s | 2 +- reactos/lib/sdk/crt/msvcrtex.cmake | 19 ++++++++++ reactos/ntoskrnl/ntos.cmake | 3 ++ 14 files changed, 116 insertions(+), 40 deletions(-) diff --git a/reactos/lib/rtl/CMakeLists.txt b/reactos/lib/rtl/CMakeLists.txt index e18152713c7..ac424b3d67e 100644 --- a/reactos/lib/rtl/CMakeLists.txt +++ b/reactos/lib/rtl/CMakeLists.txt @@ -93,6 +93,7 @@ elseif(ARCH STREQUAL "amd64") elseif(ARCH STREQUAL "arm") list(APPEND ASM_SOURCE arm/debug_asm.S) list(APPEND SOURCE + arm/except.c byteswap.c mem.c) elseif(ARCH STREQUAL "powerpc") diff --git a/reactos/lib/sdk/crt/crt.cmake b/reactos/lib/sdk/crt/crt.cmake index d9c7a60a32d..cda75eb5815 100644 --- a/reactos/lib/sdk/crt/crt.cmake +++ b/reactos/lib/sdk/crt/crt.cmake @@ -475,21 +475,54 @@ elseif(ARCH STREQUAL "amd64") except/amd64/cpp.s) endif() elseif(ARCH STREQUAL "arm") - list(APPEND LIBCNTPR_SOURCE + list(APPEND CRT_SOURCE + except/arm/ehandler.c + math/fabsf.c math/arm/__rt_sdiv.c math/arm/__rt_sdiv64_worker.c math/arm/__rt_udiv.c math/arm/__rt_udiv64_worker.c ) list(APPEND CRT_ASM_SOURCE + except/arm/_abnormal_termination.s + except/arm/_except_handler2.s + except/arm/_except_handler3.s + except/arm/_global_unwind2.s + except/arm/_local_unwind2.s + except/arm/chkstk_asm.s + float/arm/_clearfp.s + float/arm/_controlfp.s + float/arm/_fpreset.s + float/arm/_statusfp.s + math/arm/atan.s + math/arm/atan2.s + math/arm/ceil.s + math/arm/exp.s + math/arm/fabs.s + math/arm/fmod.s math/arm/floor.s + math/arm/ldexp.s + math/arm/log.s math/arm/log10.s math/arm/pow.s + math/arm/sqrt.s + math/arm/tan.s + math/arm/_logb.s + math/arm/__dtoi64.s math/arm/__dtou64.s + math/arm/__i64tod.s + math/arm/__i64tos.s math/arm/__u64tod.s + math/arm/__u64tos.s math/arm/__rt_sdiv64.s + math/arm/__rt_srsh.s math/arm/__rt_udiv64.s + setjmp/arm/setjmp.s ) + if(MSVC) + list(APPEND CRT_ASM_SOURCE + except/arm/cpp.s) + endif() endif() if(NOT ARCH STREQUAL "i386") diff --git a/reactos/lib/sdk/crt/except/arm/__jump_unwind.s b/reactos/lib/sdk/crt/except/arm/__jump_unwind.s index c1a41213e97..a98e4a4a24d 100644 --- a/reactos/lib/sdk/crt/except/arm/__jump_unwind.s +++ b/reactos/lib/sdk/crt/except/arm/__jump_unwind.s @@ -1,7 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory * PROJECT: ReactOS CRT library - * PURPOSE: Implementation of __jmp_unwind + * PURPOSE: Implementation of __jump_unwind * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -12,10 +12,10 @@ /* CODE **********************************************************************/ TEXTAREA - LEAF_ENTRY __jmp_unwind + LEAF_ENTRY __jump_unwind __assertfail bx lr - LEAF_END __jmp_unwind + LEAF_END __jump_unwind END /* EOF */ diff --git a/reactos/lib/sdk/crt/except/arm/_abnormal_termination.s b/reactos/lib/sdk/crt/except/arm/_abnormal_termination.s index ad6cb35f683..bd8c5df1069 100644 --- a/reactos/lib/sdk/crt/except/arm/_abnormal_termination.s +++ b/reactos/lib/sdk/crt/except/arm/_abnormal_termination.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _abnormal_termination - * FILE: lib/sdk/crt/except/arm/_abnormal_termination.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +13,7 @@ TEXTAREA LEAF_ENTRY _abnormal_termination - DCD 0xdefc // __assertfail + __assertfail bx lr LEAF_END _abnormal_termination diff --git a/reactos/lib/sdk/crt/except/arm/_except_handler2.s b/reactos/lib/sdk/crt/except/arm/_except_handler2.s index aa235f3aced..d643e27352c 100644 --- a/reactos/lib/sdk/crt/except/arm/_except_handler2.s +++ b/reactos/lib/sdk/crt/except/arm/_except_handler2.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _except_handler2 - * FILE: lib/sdk/crt/except/arm/_except_handler2.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +13,7 @@ TEXTAREA LEAF_ENTRY _except_handler2 - DCD 0xdefc // __assertfail + __assertfail bx lr LEAF_END _except_handler2 diff --git a/reactos/lib/sdk/crt/except/arm/_except_handler3.s b/reactos/lib/sdk/crt/except/arm/_except_handler3.s index acbd99a2ac1..802f676667b 100644 --- a/reactos/lib/sdk/crt/except/arm/_except_handler3.s +++ b/reactos/lib/sdk/crt/except/arm/_except_handler3.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _except_handler3 - * FILE: lib/sdk/crt/except/arm/_except_handler3.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +13,7 @@ TEXTAREA LEAF_ENTRY _except_handler3 - DCD 0xdefc // __assertfail + __assertfail bx lr LEAF_END _except_handler3 diff --git a/reactos/lib/sdk/crt/except/arm/_global_unwind2.s b/reactos/lib/sdk/crt/except/arm/_global_unwind2.s index e88f5da4d8e..291a875bdac 100644 --- a/reactos/lib/sdk/crt/except/arm/_global_unwind2.s +++ b/reactos/lib/sdk/crt/except/arm/_global_unwind2.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _global_unwind2 - * FILE: lib/sdk/crt/except/arm/_global_unwind2.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +13,7 @@ TEXTAREA LEAF_ENTRY _global_unwind2 - DCD 0xdefc // __assertfail + __assertfail bx lr LEAF_END _global_unwind2 diff --git a/reactos/lib/sdk/crt/except/arm/_local_unwind2.s b/reactos/lib/sdk/crt/except/arm/_local_unwind2.s index b2270d14b98..40594dfc174 100644 --- a/reactos/lib/sdk/crt/except/arm/_local_unwind2.s +++ b/reactos/lib/sdk/crt/except/arm/_local_unwind2.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _local_unwind2 - * FILE: lib/sdk/crt/except/arm/_local_unwind2.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +13,7 @@ TEXTAREA LEAF_ENTRY _local_unwind2 - DCD 0xdefc // __assertfail + __assertfail bx lr LEAF_END _local_unwind2 diff --git a/reactos/lib/sdk/crt/except/arm/chkstk_asm.s b/reactos/lib/sdk/crt/except/arm/chkstk_asm.s index 94fb754b65e..78e65772ca8 100644 --- a/reactos/lib/sdk/crt/except/arm/chkstk_asm.s +++ b/reactos/lib/sdk/crt/except/arm/chkstk_asm.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _chkstk and _alloca_probe - * FILE: lib/sdk/crt/except/arm/chkstk_asm.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) * Yuntian Zhang (yuntian.zh@gmail.com) */ @@ -14,15 +13,13 @@ /* CODE **********************************************************************/ TEXTAREA -MsgUnimplemented ASCII "Unimplemented", CR, LF, NUL - LEAF_ENTRY __chkstk - UNIMPLEMENTED chkstk + __assertfail bx lr LEAF_END __chkstk LEAF_ENTRY __alloca_probe - UNIMPLEMENTED alloca_probe + __assertfail bx lr LEAF_END __alloca_probe diff --git a/reactos/lib/sdk/crt/except/arm/chkstk_ms.s b/reactos/lib/sdk/crt/except/arm/chkstk_ms.s index ad0acf850bc..dcad0ca87e1 100644 --- a/reactos/lib/sdk/crt/except/arm/chkstk_ms.s +++ b/reactos/lib/sdk/crt/except/arm/chkstk_ms.s @@ -1,8 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries + * COPYRIGHT: BSD - See COPYING.ARM in the top level directory + * PROJECT: ReactOS CRT librariy * PURPOSE: Implementation of _chkstk and _alloca_probe - * FILE: lib/sdk/crt/except/arm/chkstk_ms.s * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) * Yuntian Zhang (yuntian.zh@gmail.com) */ @@ -14,15 +13,13 @@ /* CODE **********************************************************************/ TEXTAREA -MsgUnimplemented ASCII "Unimplemented", CR, LF, NUL - LEAF_ENTRY ___chkstk_ms - UNIMPLEMENTED chkstk_ms + __assertfail bx lr LEAF_END __chkstk_ms LEAF_ENTRY __alloca_probe - UNIMPLEMENTED alloca_probe + __assertfail bx lr LEAF_END __alloca_probe diff --git a/reactos/lib/sdk/crt/libcntpr.cmake b/reactos/lib/sdk/crt/libcntpr.cmake index d96979036ee..3e23282c19b 100644 --- a/reactos/lib/sdk/crt/libcntpr.cmake +++ b/reactos/lib/sdk/crt/libcntpr.cmake @@ -135,19 +135,48 @@ elseif(ARCH STREQUAL "amd64") math/sin.c) elseif(ARCH STREQUAL "arm") list(APPEND LIBCNTPR_SOURCE + except/arm/chkstk_asm.s + except/arm/__jump_unwind.s math/arm/__rt_sdiv.c math/arm/__rt_sdiv64_worker.c math/arm/__rt_udiv.c math/arm/__rt_udiv64_worker.c ) list(APPEND LIBCNTPR_ASM_SOURCE + except/arm/_abnormal_termination.s + except/arm/_except_handler2.s + except/arm/_except_handler3.s + except/arm/_global_unwind2.s + except/arm/_local_unwind2.s + except/arm/chkstk_asm.s + except/arm/ehandler.c + float/arm/_clearfp.s + float/arm/_controlfp.s + float/arm/_fpreset.s + float/arm/_statusfp.s + math/arm/atan.s + math/arm/atan2.s + math/arm/ceil.s + math/arm/exp.s + math/arm/fabs.s + math/arm/fmod.s math/arm/floor.s + math/arm/ldexp.s + math/arm/log.s math/arm/log10.s math/arm/pow.s + math/arm/sqrt.s + math/arm/tan.s + math/arm/__dtoi64.s math/arm/__dtou64.s + math/arm/__i64tod.s + math/arm/__i64tos.s math/arm/__u64tod.s + math/arm/__u64tos.s math/arm/__rt_sdiv64.s + math/arm/__rt_srsh.s math/arm/__rt_udiv64.s + setjmp/arm/setjmp.s ) endif() @@ -178,6 +207,8 @@ if(ARCH STREQUAL "i386") string/i386/wcsrchr_asm.s) else() list(APPEND LIBCNTPR_SOURCE + math/cos.c + math/sin.c mem/memchr.c mem/memcpy.c mem/memmove.c diff --git a/reactos/lib/sdk/crt/math/arm/floor.s b/reactos/lib/sdk/crt/math/arm/floor.s index 9dce0383278..d86cf7314b4 100644 --- a/reactos/lib/sdk/crt/math/arm/floor.s +++ b/reactos/lib/sdk/crt/math/arm/floor.s @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include /* CODE **********************************************************************/ diff --git a/reactos/lib/sdk/crt/msvcrtex.cmake b/reactos/lib/sdk/crt/msvcrtex.cmake index 5eef28f0d3f..04a3f914bd4 100644 --- a/reactos/lib/sdk/crt/msvcrtex.cmake +++ b/reactos/lib/sdk/crt/msvcrtex.cmake @@ -64,6 +64,25 @@ elseif(ARCH STREQUAL "amd64") list(APPEND MSVCRTEX_ASM_SOURCE except/amd64/chkstk_asm.s except/amd64/chkstk_ms.s) +elseif(ARCH STREQUAL "arm") + list(APPEND MSVCRTEX_SOURCE + math/arm/__rt_sdiv.c + math/arm/__rt_sdiv64_worker.c + math/arm/__rt_udiv.c + math/arm/__rt_udiv64_worker.c + ) + list(APPEND MSVCRTEX_ASM_SOURCE + except/arm/chkstk_asm.s + math/arm/__dtoi64.s + math/arm/__dtou64.s + math/arm/__i64tod.s + math/arm/__i64tos.s + math/arm/__u64tod.s + math/arm/__u64tos.s + math/arm/__rt_sdiv64.s + math/arm/__rt_srsh.s + math/arm/__rt_udiv64.s + ) endif() if(MSVC) diff --git a/reactos/ntoskrnl/ntos.cmake b/reactos/ntoskrnl/ntos.cmake index 6c42c3bc44b..f51673c9a0b 100644 --- a/reactos/ntoskrnl/ntos.cmake +++ b/reactos/ntoskrnl/ntos.cmake @@ -327,14 +327,17 @@ elseif(ARCH STREQUAL "amd64") ${REACTOS_SOURCE_DIR}/ntoskrnl/ps/amd64/psctx.c) elseif(ARCH STREQUAL "arm") list(APPEND ASM_SOURCE + ${REACTOS_SOURCE_DIR}/ntoskrnl/ex/arm/ioport.s ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/boot.s ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/ctxswtch.s ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/stubs_asm.s ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/trap.s) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/config/arm/cmhardwr.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/kd/arm/kdbg.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/cpu.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/exp.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/interrupt.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/kiinit.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/thrdini.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/arm/trapc.c