2N/A/*
2N/A * GRUB -- GRand Unified Bootloader
2N/A * Copyright (C) 2003,2007,2009 Free Software Foundation, Inc.
2N/A *
2N/A * GRUB is free software: you can redistribute it and/or modify
2N/A * it under the terms of the GNU General Public License as published by
2N/A * the Free Software Foundation, either version 3 of the License, or
2N/A * (at your option) any later version.
2N/A *
2N/A * GRUB is distributed in the hope that it will be useful,
2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A * GNU General Public License for more details.
2N/A *
2N/A * You should have received a copy of the GNU General Public License
2N/A * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A */
2N/A
2N/A#include <grub/symbol.h>
2N/A#include <grub/dl.h>
2N/A
2N/A .file "setjmp.S"
2N/A
2N/AGRUB_MOD_LICENSE ("GPLv3+")
2N/A
2N/A .text
2N/A
2N/A/*
2N/A * int grub_setjmp (grub_jmp_buf env)
2N/A */
2N/AFUNCTION(grub_setjmp)
2N/A sw $s0, 0($a0)
2N/A sw $s1, 4($a0)
2N/A sw $s2, 8($a0)
2N/A sw $s3, 12($a0)
2N/A sw $s4, 16($a0)
2N/A sw $s5, 20($a0)
2N/A sw $s6, 24($a0)
2N/A sw $s7, 28($a0)
2N/A sw $s8, 32($a0)
2N/A sw $gp, 36($a0)
2N/A sw $sp, 40($a0)
2N/A sw $ra, 44($a0)
2N/A move $v0, $zero
2N/A move $v1, $zero
2N/A jr $ra
2N/A/*
2N/A * int grub_longjmp (grub_jmp_buf env, int val)
2N/A */
2N/AFUNCTION(grub_longjmp)
2N/A lw $s0, 0($a0)
2N/A lw $s1, 4($a0)
2N/A lw $s2, 8($a0)
2N/A lw $s3, 12($a0)
2N/A lw $s4, 16($a0)
2N/A lw $s5, 20($a0)
2N/A lw $s6, 24($a0)
2N/A lw $s7, 28($a0)
2N/A lw $s8, 32($a0)
2N/A lw $gp, 36($a0)
2N/A lw $sp, 40($a0)
2N/A lw $ra, 44($a0)
2N/A move $v0, $a1
2N/A bne $v0, $zero, 1f
2N/A addiu $v0, $v0, 1
2N/A1:
2N/A move $v1, $zero
2N/A jr $ra