2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2000 Free Software Foundation, Inc.
5 * This program 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 2 of the License, or
8 * (at your option) any later version.
10 * This program 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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 /* This is stolen from libc/x86/setjmp.S in the OSKit */
21 * Mach Operating System
22 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
23 * All Rights Reserved.
25 * Permission to use, copy, modify and distribute this software and its
26 * documentation is hereby granted, provided that both the copyright
27 * notice and this permission notice appear in all copies of the
28 * software, derivative works or modified versions, and any portions
29 * thereof, and that both notices appear in supporting documentation.
31 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
32 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
33 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
35 * Carnegie Mellon requests users of this software to return to
37 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
38 * School of Computer Science
39 * Carnegie Mellon University
40 * Pittsburgh PA 15213-3890
42 * any improvements or extensions that they make and grant Carnegie Mellon
43 * the rights to redistribute these changes.
46 * C library -- _setjmp, _longjmp
49 * will generate a "return(v)" from
52 * by restoring registers from the stack,
53 * The previous signal state is NOT restored.
57 #define EXT_C(sym) sym
58 #define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x):
65 movl 4(%esp), %ecx /* fetch buffer */
69 movl %ebp, 12(%ecx) /* save frame pointer of caller */
71 movl %esp, 16(%ecx) /* save stack pointer of caller */
72 movl %edx, 20(%ecx) /* save pc of caller */
77 movl 8(%esp), %eax /* return(v) */
78 movl 4(%esp), %ecx /* fetch buffer */
87 0: jmp *20(%ecx) /* done, return.... */