source: mainline/boot/arch/ia64/src/sal_asm.S@ d735e2e

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since d735e2e was 27f67f5, checked in by Jakub Jermar <jakub@…>, 9 years ago

ia64: use asmtool.h macros for defining symbols

  • Property mode set to 100644
File size: 2.6 KB
Line 
1#
2# Copyright (c) 2011 Jakub Jermar
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
29#include <abi/asmtool.h>
30
31.explicit
32
33#define STACK_SCRATCH_AREA 16
34#define STACK_IN8 (0 + STACK_SCRATCH_AREA)
35#define STACK_IN9 (8 + STACK_SCRATCH_AREA)
36#define STACK_IN10 (16 + STACK_SCRATCH_AREA)
37
38#
39# Assume the following PSR bits are already 0, as expected by SAL:
40#
41# be, cpl, is, da, dd, ss, ri, ed, ia
42#
43# Assume PSR.bn is 1, as expected by SAL.
44#
45FUNCTION_BEGIN(sal_call)
46 alloc loc0 = ar.pfs, 8, 8, 8, 0
47
48 adds sp = -STACK_SCRATCH_AREA, sp
49
50 mov loc1 = gp
51 mov loc2 = rp
52
53 addl loc3 = @gprel(sal_proc), gp
54 addl loc4 = @gprel(sal_proc_gp), gp
55
56 mov out0 = in0
57 mov out1 = in1
58 mov out2 = in2
59 mov out3 = in3
60 mov out4 = in4
61 mov out5 = in5
62 mov out6 = in6
63 mov out7 = in7 ;;
64
65 ld8 loc3 = [loc3]
66 ld8 gp = [loc4]
67
68 adds r14 = STACK_IN8 + STACK_SCRATCH_AREA, sp
69 adds r15 = STACK_IN9 + STACK_SCRATCH_AREA, sp
70 adds r16 = STACK_IN10 + STACK_SCRATCH_AREA, sp ;;
71
72 ld8 loc5 = [r14]
73 ld8 loc6 = [r15]
74 ld8 loc7 = [r16]
75
76 mov b6 = loc3 ;;
77 br.call.sptk.many rp = b6
78
79 cmp.ne p7,p0 = 0, loc5
80 cmp.ne p8,p0 = 0, loc6
81 cmp.ne p9,p0 = 0, loc7 ;;
82
83(p7) st8 [loc5] = r9
84(p8) st8 [loc6] = r10
85(p9) st8 [loc7] = r11
86
87 mov gp = loc1
88 mov rp = loc2
89
90 adds sp = STACK_SCRATCH_AREA, sp ;;
91
92 mov ar.pfs = loc0
93 br.ret.sptk.many rp
94FUNCTION_END(sal_call)
95
Note: See TracBrowser for help on using the repository browser.