xref: /AOO41X/main/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S (revision b5da552ccefc4034e06a43bfae43fb8a8b64a7ad)
1*b5da552cSAndrew Rist@
2*b5da552cSAndrew Rist@   Licensed to the Apache Software Foundation (ASF) under one
3*b5da552cSAndrew Rist@   or more contributor license agreements.  See the NOTICE file
4*b5da552cSAndrew Rist@   distributed with this work for additional information
5*b5da552cSAndrew Rist@   regarding copyright ownership.  The ASF licenses this file
6*b5da552cSAndrew Rist@   to you under the Apache License, Version 2.0 (the
7*b5da552cSAndrew Rist@   "License"); you may not use this file except in compliance
8*b5da552cSAndrew Rist@   with the License.  You may obtain a copy of the License at
9*b5da552cSAndrew Rist@
10*b5da552cSAndrew Rist@     http://www.apache.org/licenses/LICENSE-2.0
11*b5da552cSAndrew Rist@
12*b5da552cSAndrew Rist@   Unless required by applicable law or agreed to in writing,
13*b5da552cSAndrew Rist@   software distributed under the License is distributed on an
14*b5da552cSAndrew Rist@   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15*b5da552cSAndrew Rist@   KIND, either express or implied.  See the License for the
16*b5da552cSAndrew Rist@   specific language governing permissions and limitations
17*b5da552cSAndrew Rist@   under the License.
18*b5da552cSAndrew Rist@
19*b5da552cSAndrew Rist
20cdf0e10cSrcweir@ ARM support code for OpenOffice C++/UNO bridging
21cdf0e10cSrcweir@
22cdf0e10cSrcweir@ Written by Peter Naulls <peter@chocky.org>
23cdf0e10cSrcweir@ Modified by Caolan McNamara <caolanm@redhat.com>
24cdf0e10cSrcweir@ Fixed by Michael Casadevall <mcasadevall@kubuntu.org>
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifdef __ARM_EABI__
27cdf0e10cSrcweir#  define UNWIND
28cdf0e10cSrcweir#else
29cdf0e10cSrcweir#  define UNWIND @
30cdf0e10cSrcweir#endif
31cdf0e10cSrcweir
32cdf0e10cSrcweir	.file	"armhelper.s"
33cdf0e10cSrcweir	.text
34cdf0e10cSrcweir	.align	4
35cdf0e10cSrcweir	.global privateSnippetExecutor
36cdf0e10cSrcweir	.type privateSnippetExecutor, %function
37cdf0e10cSrcweirprivateSnippetExecutor:
38cdf0e10cSrcweir	UNWIND .fnstart            @ start of unwinder entry
39cdf0e10cSrcweir
40cdf0e10cSrcweir	stmfd sp!, {r0-r3}         @ follow other parameters on stack
41cdf0e10cSrcweir	UNWIND .pad  #16           @ throw this data away on exception
42cdf0e10cSrcweir	mov   r0, ip               @ r0 points to functionoffset/vtable
43cdf0e10cSrcweir	mov   r1, sp               @ r1 points to this and params
44cdf0e10cSrcweir	                           @ (see cppuno.cxx:codeSnippet())
45cdf0e10cSrcweir	stmfd sp!, {r4,lr}         @ save return address
46cdf0e10cSrcweir	                           @ (r4 pushed to preserve stack alignment)
47cdf0e10cSrcweir	UNWIND .save {r4,lr}       @ restore these regs on exception
48cdf0e10cSrcweir
49cdf0e10cSrcweir	bl    cpp_vtable_call(PLT)
50cdf0e10cSrcweir
51cdf0e10cSrcweir	add   sp, sp, #4           @ no need to restore r4 (we didn't touch it)
52cdf0e10cSrcweir	ldr   pc, [sp], #20        @ return, discarding function arguments
53cdf0e10cSrcweir
54cdf0e10cSrcweir	UNWIND .fnend              @ end of unwinder entry
55cdf0e10cSrcweir
56cdf0e10cSrcweir	.size privateSnippetExecutor, . - privateSnippetExecutor
57cdf0e10cSrcweir        .section        .note.GNU-stack,"",%progbits
58