diff --git a/src/system/libroot/os/arch/sparc/Jamfile b/src/system/libroot/os/arch/sparc/Jamfile index 725be98c7d..43d9ed6aff 100644 --- a/src/system/libroot/os/arch/sparc/Jamfile +++ b/src/system/libroot/os/arch/sparc/Jamfile @@ -13,6 +13,8 @@ for architectureObject in [ MultiArchSubDirSetup sparc ] { SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; MergeObject <$(architecture)>os_arch_$(TARGET_ARCH).o : + byteorder.S + stack_frame.c system_time.c thread.c diff --git a/src/system/libroot/os/arch/sparc/byteorder.S b/src/system/libroot/os/arch/sparc/byteorder.S new file mode 100644 index 0000000000..c7aa4616df --- /dev/null +++ b/src/system/libroot/os/arch/sparc/byteorder.S @@ -0,0 +1,32 @@ +/* + * Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk + * Distributed under the terms of the MIT License. + */ + +#include + +.text + +// These function use the unused parameters slots on the stack (reserved for +// arguments that are in fact passed in registers) for temporary storage. +// %o0 is corrupt, but it is a scratch register so this should be fine. + +/* float __swap_float(float value) + */ +FUNCTION(__swap_float): + add %sp, 2175, %o0 + st %d0, [%o0] + lda [%o0] 0x88, %d0 + return +FUNCTION_END(__swap_float) + + +/* double __swap_double(double value) + */ +FUNCTION(__swap_double): + add %sp, 2175, %o0 + std %d0, [%o0] + ldda [%o0] 0x88, %d0 + return +FUNCTION_END(__swap_double) +