diff options
-rw-r--r-- | src/Native/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/Native/Runtime/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/Native/Runtime/arm64/AsmMacros.h | 41 | ||||
-rw-r--r-- | src/Native/Runtime/arm64/WriteBarriers.S | 35 |
4 files changed, 85 insertions, 0 deletions
diff --git a/src/Native/CMakeLists.txt b/src/Native/CMakeLists.txt index 120dce68f..2d7a9243d 100644 --- a/src/Native/CMakeLists.txt +++ b/src/Native/CMakeLists.txt @@ -27,6 +27,11 @@ elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l) add_compile_options(-target armv7-linux-gnueabihf) add_compile_options(-mthumb) add_compile_options(-mfpu=vfpv3) +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) + set(IS_64BIT_BUILD 1) + # Because we don't use CMAKE_C_COMPILER/CMAKE_CXX_COMPILER to use clang + # we have to set the triple by adding a compiler argument + add_compile_options(-target aarch64-linux-gnu) endif () if(CMAKE_SYSTEM_NAME STREQUAL Linux) @@ -134,6 +139,7 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_ARM) add_definitions(-D_ARM_) elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64) add_definitions(-D_TARGET_ARM64_=1) + add_definitions(-D_ARM64_) else() clr_unknown_arch() endif() diff --git a/src/Native/Runtime/CMakeLists.txt b/src/Native/Runtime/CMakeLists.txt index 2ce4f52f2..82427af24 100644 --- a/src/Native/Runtime/CMakeLists.txt +++ b/src/Native/Runtime/CMakeLists.txt @@ -81,6 +81,9 @@ else() if(CLR_CMAKE_PLATFORM_ARCH_AMD64) set(ARCH_SOURCES_DIR amd64) set(ASM_SUFFIX S) + elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64) + set(ARCH_SOURCES_DIR arm64) + set(ASM_SUFFIX S) elseif(CLR_CMAKE_PLATFORM_ARCH_ARM) set(ARCH_SOURCES_DIR arm) set(ASM_SUFFIX S) diff --git a/src/Native/Runtime/arm64/AsmMacros.h b/src/Native/Runtime/arm64/AsmMacros.h new file mode 100644 index 000000000..bbb625995 --- /dev/null +++ b/src/Native/Runtime/arm64/AsmMacros.h @@ -0,0 +1,41 @@ +;; +;; Copyright(c) Microsoft.All rights reserved. +;; Licensed under the MIT license.See LICENSE file in the project root for full license information. +;; + +;; OS provided macros +#include <ksarm.h> +;; generated by the build from AsmOffsets.cpp +#include "AsmOffsets.inc" + +;; +;; CONSTANTS -- INTEGER +;; +TSF_Attached equ 0x01 +TSF_SuppressGcStress equ 0x08 +TSF_DoNotTriggerGc equ 0x10 +TSF_SuppressGcStress__OR__TSF_DoNotTriggerGC equ 0x18 + +;; Slot number of the Finalize virtual method. +METHOD_SLOT_Finalize equ 0 + +;; GC type flags +GC_ALLOC_FINALIZE equ 1 +GC_ALLOC_ALIGN8_BIAS equ 4 +GC_ALLOC_ALIGN8 equ 8 + +;; Note: these must match the defs in PInvokeTransitionFrameFlags defined in rhbinder.h +;; FIXME:ARM64 + +;; +;; This constant, unfortunately, cannot be validated at build time. +;; FIXME:ARM64 +;; +OFFSETOF__TLS__tls_CurrentThread equ 0x10 + +;; +;; Rename fields of nested structs +;; +OFFSETOF__Thread__m_alloc_context__alloc_ptr equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__alloc_context__alloc_ptr +OFFSETOF__Thread__m_alloc_context__alloc_limit equ OFFSETOF__Thread__m_rgbAllocContextBuffer + OFFSETOF__alloc_context__alloc_limit + diff --git a/src/Native/Runtime/arm64/WriteBarriers.S b/src/Native/Runtime/arm64/WriteBarriers.S new file mode 100644 index 000000000..80a5f815a --- /dev/null +++ b/src/Native/Runtime/arm64/WriteBarriers.S @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +// TODO: Implement Unix write barriers +#include <unixasmmacros.inc> + +LEAF_ENTRY RhpAssignRef, _TEXT + str x1, [x0] + ret +LEAF_END RhpAssignRef, _TEXT + +LEAF_ENTRY RhpCheckedAssignRef, _TEXT + str x1, [x0] + ret +LEAF_END RhpCheckedAssignRef, _TEXT + +// +// RhpByRefAssignRef simulates movs instruction for object references. +// +// On entry: +// x0: address of ref-field (assigned to) +// x1: address of the data (source) +// x3: be trashed +// +// On exit: +// x0, x1 are incremented by 8, +// x3: trashed +// +LEAF_ENTRY RhpByRefAssignRef, _TEXT + ldr x3, [x1], #8 + str x3, [x0], #8 + ret +LEAF_END RhpByRefAssignRef, _TEXT |