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