source: grub-pc/trunk/fuentes/grub-core/lib/x86_64/setjmp.S @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 1.6 KB
Line 
1/*
2 *  GRUB  --  GRand Unified Bootloader
3 *  Copyright (C) 2003,2007  Free Software Foundation, Inc.
4 *
5 *  GRUB is free software: you can redistribute it and/or modify
6 *  it under the terms of the GNU General Public License as published by
7 *  the Free Software Foundation, either version 3 of the License, or
8 *  (at your option) any later version.
9 *
10 *  GRUB is distributed in the hope that it will be useful,
11 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 *  GNU General Public License for more details.
14 *
15 *  You should have received a copy of the GNU General Public License
16 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <grub/symbol.h>
20#include <grub/dl.h>
21
22        .file   "setjmp.S"
23
24GRUB_MOD_LICENSE "GPLv3+"
25
26        .text
27
28/*
29 *  jmp_buf:
30 *   rbx rsp rbp r12 r13 r14 r15 rip
31 *   0   8   16  24  32  40  48  56
32 */
33
34/*
35 * int grub_setjmp (grub_jmp_buf env)
36 */
37FUNCTION(grub_setjmp)
38        pop     %rsi            /* Return address, and adjust the stack */
39        xorq    %rax, %rax
40        movq    %rbx, 0(%rdi)   /* RBX */
41        movq    %rsp, 8(%rdi)   /* RSP */
42        push    %rsi
43        movq    %rbp, 16(%rdi)  /* RBP */
44        movq    %r12, 24(%rdi)  /* R12 */
45        movq    %r13, 32(%rdi)  /* R13 */
46        movq    %r14, 40(%rdi)  /* R14 */
47        movq    %r15, 48(%rdi)  /* R15 */
48        movq    %rsi, 56(%rdi)  /* RSI */
49        ret
50
51/*
52 * int grub_longjmp (grub_jmp_buf env, int val)
53 */
54FUNCTION(grub_longjmp)
55        movl    %esi, %eax
56        orl     %eax, %eax
57        jnz     1f
58        incl    %eax
591:
60
61        movq    (%rdi), %rbx
62        movq    8(%rdi), %rsp
63        movq    16(%rdi), %rbp
64        movq    24(%rdi), %r12
65        movq    32(%rdi), %r13
66        movq    40(%rdi), %r14
67        movq    48(%rdi), %r15
68        jmp     *56(%rdi)
Note: See TracBrowser for help on using the repository browser.