OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libitm/] [config/] [x86/] [sjlj.S] - Blame information for rev 767

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 737 jeremybenn
/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
2
   Contributed by Richard Henderson .
3
 
4
   This file is part of the GNU Transactional Memory Library (libitm).
5
 
6
   Libitm is free software; you can redistribute it and/or modify it
7
   under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 3 of the License, or
9
   (at your option) any later version.
10
 
11
   Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
12
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14
   more details.
15
 
16
   Under Section 7 of GPL version 3, you are granted additional
17
   permissions described in the GCC Runtime Library Exception, version
18
   3.1, as published by the Free Software Foundation.
19
 
20
   You should have received a copy of the GNU General Public License and
21
   a copy of the GCC Runtime Library Exception along with this program;
22
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23
   .  */
24
 
25
 
26
#include "asmcfi.h"
27
 
28
#define CONCAT1(a, b) CONCAT2(a, b)
29
#define CONCAT2(a, b) a ## b
30
 
31
#ifdef __USER_LABEL_PREFIX__
32
#  define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
33
#else
34
#  define SYM(x) x
35
#endif
36
 
37
#ifdef __ELF__
38
#  define TYPE(x) .type SYM(x), @function
39
#  define SIZE(x) .size SYM(x), . - SYM(x)
40
#  ifdef HAVE_ATTRIBUTE_VISIBILITY
41
#    define HIDDEN(x) .hidden SYM(x)
42
#  else
43
#    define HIDDEN(x)
44
#  endif
45
#else
46
#  define TYPE(x)
47
#  define SIZE(x)
48
#  ifdef __MACH__
49
#    define HIDDEN(x) .private_extern SYM(x)
50
#  else
51
#    define HIDDEN(x)
52
#  endif
53
#endif
54
 
55
        .text
56
 
57
        .align 4
58
        .globl  SYM(_ITM_beginTransaction)
59
 
60
SYM(_ITM_beginTransaction):
61
        cfi_startproc
62
#ifdef __x86_64__
63
        leaq    8(%rsp), %rax
64
        subq    $56, %rsp
65
        cfi_def_cfa_offset(64)
66
        movq    %rax, (%rsp)
67
        movq    %rbx, 8(%rsp)
68
        movq    %rbp, 16(%rsp)
69
        movq    %r12, 24(%rsp)
70
        movq    %r13, 32(%rsp)
71
        movq    %r14, 40(%rsp)
72
        movq    %r15, 48(%rsp)
73
        movq    %rsp, %rsi
74
        call    SYM(GTM_begin_transaction)
75
        addq    $56, %rsp
76
        cfi_def_cfa_offset(8)
77
        ret
78
#else
79
        leal    4(%esp), %ecx
80
        movl    4(%esp), %eax
81
        subl    $28, %esp
82
        cfi_def_cfa_offset(32)
83
        movl    %ecx, 8(%esp)
84
        movl    %ebx, 12(%esp)
85
        movl    %esi, 16(%esp)
86
        movl    %edi, 20(%esp)
87
        movl    %ebp, 24(%esp)
88
        leal    8(%esp), %edx
89
#if defined HAVE_ATTRIBUTE_VISIBILITY || !defined __PIC__
90
        call    SYM(GTM_begin_transaction)
91
#elif defined __ELF__
92
        call    1f
93
1:      popl    %ebx
94
        addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
95
        call    SYM(GTM_begin_transaction)@PLT
96
        movl    12(%esp), %ebx
97
#else
98
# error "Unsupported PIC sequence"
99
#endif
100
        addl    $28, %esp
101
        cfi_def_cfa_offset(4)
102
        ret
103
#endif
104
        cfi_endproc
105
 
106
        TYPE(_ITM_beginTransaction)
107
        SIZE(_ITM_beginTransaction)
108
 
109
        .align 4
110
        .globl  SYM(GTM_longjmp)
111
 
112
SYM(GTM_longjmp):
113
        cfi_startproc
114
#ifdef __x86_64__
115
        movq    (%rsi), %rcx
116
        movq    8(%rsi), %rbx
117
        movq    16(%rsi), %rbp
118
        movq    24(%rsi), %r12
119
        movq    32(%rsi), %r13
120
        movq    40(%rsi), %r14
121
        movq    48(%rsi), %r15
122
        movl    %edi, %eax
123
        cfi_def_cfa(%rsi, 0)
124
        cfi_offset(%rip, 56)
125
        cfi_register(%rsp, %rcx)
126
        movq    %rcx, %rsp
127
        jmp     *56(%rsi)
128
#else
129
        movl    (%edx), %ecx
130
        movl    4(%edx), %ebx
131
        movl    8(%edx), %esi
132
        movl    12(%edx), %edi
133
        movl    16(%edx), %ebp
134
        cfi_def_cfa(%edx, 0)
135
        cfi_offset(%eip, 20)
136
        cfi_register(%esp, %ecx)
137
        movl    %ecx, %esp
138
        jmp     *20(%edx)
139
#endif
140
        cfi_endproc
141
 
142
        TYPE(GTM_longjmp)
143
        HIDDEN(GTM_longjmp)
144
        SIZE(GTM_longjmp)
145
 
146
#ifdef __linux__
147
.section .note.GNU-stack, "", @progbits
148
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.