diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S | |
parent | Initial commit. (diff) | |
download | libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S')
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S b/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S new file mode 100644 index 000000000..e03bff1d2 --- /dev/null +++ b/bridges/source/cpp_uno/msvc_win32_arm64/callvirtualfunction.S @@ -0,0 +1,72 @@ +/* -*- tab-width: 4; indent-tabs-mode: nil; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + + OPT 2 // disable listing +// macros to add unwind information +#include "ksarm64.h" + OPT 1 // re-enable listing + + EXPORT callVirtualFunction + + TEXTAREA, ALIGN=8 + +/* + extern void callVirtualFunction + + x0 stack + x1 frame + x2 function + x3 return +*/ + + NESTED_ENTRY callVirtualFunction_fake + + // for unwind information, Windows has to store fp and lr + PROLOG_SAVE_REG_PAIR x29, x30, #-32! + + ALTERNATE_ENTRY callVirtualFunction + + // use a stack frame allocated by our caller + stp x29, x30, [x1] + mov x29, x1 + mov sp, x0 + + mov x9, x2 // function + mov x8, x3 // complex return + str x3, [x29, #16] // save rvalue + + // load the core argument passing registers + ldp x0, x1, [sp, #0] + ldp x2, x3, [sp, #16] + ldp x4, x5, [sp, #32] + ldp x6, x7, [sp, #48] + + ldp d0, d1, [sp, #64] + ldp d2, d3, [sp, #80] + ldp d4, d5, [sp, #96] + ldp d6, d7, [sp, #112] + + blr x9 // call + + ldr x3, [x29, #16] // reload rvalue + + // partially deconstruct the stack frame + mov sp, x29 + ldp x29, x30, [x29] + + // save the simple return values + stp x0, x1, [sp, #0] + stp d0, d1, [sp, #64] + stp d2, d3, [sp, #80] + + NESTED_END callVirtualFunction_fake + + END + +/* vim:set shiftwidth=4 softtabstop=4 expandtab */ |