File: ulp_interface.S

package info (click to toggle)
libpulp 0.3.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,976 kB
  • sloc: ansic: 11,792; python: 1,216; sh: 881; makefile: 871; cpp: 582; asm: 387
file content (124 lines) | stat: -rw-r--r-- 3,091 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 *  libpulp - User-space Livepatching Library
 *
 *  Copyright (C) 2017-2024 SUSE Software Solutions GmbH
 *
 *  This file is part of libpulp.
 *
 *  libpulp is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  libpulp is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with libpulp.  If not, see <http://www.gnu.org/licenses/>.
 */

/* Prevent the stack from being needlessly set to executable.  */
.section .note.GNU-stack,"",%progbits

.section .text,"ax",@progbits

/*
 * The functions below are the entry points into libpulp, which are
 * accessed from libpulp's tools, such as the trigger tool. The two
 * nops here is to take into account syscall restarting by the kernel.
 */

.global __ulp_revert_all
    nop
    nop
__ulp_revert_all:
    nop
    nop
    addis   2, 12, .TOC.-__ulp_revert_all@ha
    addi    2, 2,  .TOC.-__ulp_revert_all@l
    mflr    %r0
    std     %r0,16(%r1)
    stdu    %r1,-32(%r1)
    bl      __ulp_revert_patches_from_lib
    nop
    addi    %r1,%r1,32
    ld      %r0,16(%r1)
    mtlr    %r0
    trap

.globl __ulp_trigger
.type  __ulp_trigger, @function
    nop
    nop
__ulp_trigger:
    nop
    nop
    addis   2, 12, .TOC.-__ulp_trigger@ha
    addi    2, 2,  .TOC.-__ulp_trigger@l
    #.localentry     __ulp_trigger,.-__ulp_trigger
    mflr    %r0
    std     %r0,16(%r1)
    stdu    %r1,-32(%r1)
    bl      __ulp_apply_patch
    nop
    addi    %r1,%r1,32
    ld      %r0,16(%r1)
    mtlr    %r0
    trap

.global __ulp_check_patched
    nop
    nop
__ulp_check_patched:
    nop
    nop
    addis   2, 12, .TOC.-__ulp_check_patched@ha
    addi    2, 2,  .TOC.-__ulp_check_patched@l
    mflr    %r0
    std     %r0,16(%r1)
    stdu    %r1,-32(%r1)
    bl      __ulp_check_applied_patch
    nop
    addi    %r1,%r1,32
    ld      %r0,16(%r1)
    mtlr    %r0
    trap

.global __ulp_get_global_universe
    nop
    nop
__ulp_get_global_universe:
    nop
    nop
    addis   2, 12, .TOC.-__ulp_get_global_universe@ha
    addi    2, 2,  .TOC.-__ulp_get_global_universe@l
    mflr    %r0
    std     %r0,16(%r1)
    stdu    %r1,-32(%r1)
    bl      __ulp_get_global_universe_value
    nop
    addi    %r1,%r1,32
    ld      %r0,16(%r1)
    mtlr    %r0
    trap


.global __ulp_enable_or_disable_patching
    nop
    nop
__ulp_enable_or_disable_patching:
    nop
    nop
    addis   2, 12, .TOC.-__ulp_enable_or_disable_patching@ha
    addi    2, 2,  .TOC.-__ulp_enable_or_disable_patching@l
    mflr    %r0
    std     %r0,16(%r1)
    stdu    %r1,-32(%r1)
    bl      ulp_enable_or_disable_patching
    nop
    addi    %r1,%r1,32
    ld      %r0,16(%r1)
    mtlr    %r0
    trap