diff --git a/src/system/kernel/lib/arch/arm64/Jamfile b/src/system/kernel/lib/arch/arm64/Jamfile index e1a5e14323..8d106db8d6 100644 --- a/src/system/kernel/lib/arch/arm64/Jamfile +++ b/src/system/kernel/lib/arch/arm64/Jamfile @@ -9,6 +9,7 @@ SEARCH_SOURCE += [ FDirName $(librootSources) os arch $(TARGET_ARCH) ] ; SEARCH_SOURCE += [ FDirName $(librootSources) os arch generic ] ; KernelMergeObject kernel_os_arch_$(TARGET_ARCH).o : + byteorder.S generic_atomic.cpp generic_system_time_nsecs.cpp @@ -24,7 +25,7 @@ KernelMergeObject kernel_lib_posix_arch_$(TARGET_ARCH).o : sigsetjmp.S kernel_longjmp_return.c kernel_setjmp_save_sigs.c - + arch_string.S memset.c memcpy.c diff --git a/src/system/libroot/os/arch/arm64/Jamfile b/src/system/libroot/os/arch/arm64/Jamfile index fe33fee20f..e38ab9dc01 100644 --- a/src/system/libroot/os/arch/arm64/Jamfile +++ b/src/system/libroot/os/arch/arm64/Jamfile @@ -13,11 +13,12 @@ for architectureObject in [ MultiArchSubDirSetup arm64 ] { SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; MergeObject <$(architecture)>os_arch_$(TARGET_ARCH).o : - tls.c - thread.c - system_time.c - time.c + byteorder.S get_stack_frame.S + system_time.c + thread.c + time.c + tls.c generic_atomic.cpp generic_stack_trace.cpp diff --git a/src/system/libroot/os/arch/arm64/byteorder.S b/src/system/libroot/os/arch/arm64/byteorder.S new file mode 100644 index 0000000000..dc5ad70a94 --- /dev/null +++ b/src/system/libroot/os/arch/arm64/byteorder.S @@ -0,0 +1,26 @@ +/* + * Copyright 2021, Haiku, Inc. All rights reserved. + * Released under the terms of the MIT License + */ + + +#include + +.text + +/* float __swap_float(float value) */ +FUNCTION(__swap_float): + fmov s0, w0 // Bitcopy float to general register + rev w0, w0 // GCC8.3 does this for __builtin_bswap32 + fmov w0, s0 // and back + ret +FUNCTION_END(__swap_float) + + +/* double __swap_double(double value) */ +FUNCTION(__swap_double): + fmov d0, x0 // Bitcopy double to general register + rev x0, x0 // GCC8.3 does this for __builtin_bswap64 + fmov x0, d0 // and back + ret +FUNCTION_END(__swap_double)