merge bootcheck and mainline into newreloc

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-20 11:48:36 +01:00
commit 3c83bc50db
165 changed files with 4132 additions and 665 deletions

View file

@ -1,7 +1,7 @@
/* kern/i386/datetime.c - x86 CMOS datetime function.
/* kern/cmos_datetime.c - CMOS datetime function.
*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -18,7 +18,7 @@
*/
#include <grub/datetime.h>
#include <grub/i386/cmos.h>
#include <grub/cmos.h>
grub_err_t
grub_get_datetime (struct grub_datetime *datetime)

View file

@ -31,21 +31,22 @@ hexdump (unsigned long bse, char *buf, int len)
{
int cnt, i;
pos = grub_sprintf (line, "%08lx ", bse);
pos = grub_snprintf (line, sizeof (line), "%08lx ", bse);
cnt = 16;
if (cnt > len)
cnt = len;
for (i = 0; i < cnt; i++)
{
pos += grub_sprintf (&line[pos], "%02x ", (unsigned char) buf[i]);
pos += grub_snprintf (&line[pos], sizeof (line) - pos,
"%02x ", (unsigned char) buf[i]);
if ((i & 7) == 7)
line[pos++] = ' ';
}
for (; i < 16; i++)
{
pos += grub_sprintf (&line[pos], " ");
pos += grub_snprintf (&line[pos], sizeof (line) - pos, " ");
if ((i & 7) == 7)
line[pos++] = ' ';
}

View file

@ -36,7 +36,7 @@ extern grub_uint8_t grub_relocator32_backward_start;
extern grub_uint8_t grub_relocator32_backward_end;
#define REGW_SIZEOF (2 * sizeof (grub_uint32_t))
#define JUMP_SIZEOF (sizeof (grub_uint32_t))
#define JUMP_SIZEOF (2 * sizeof (grub_uint32_t))
#define RELOCATOR_SRC_SIZEOF(x) (&grub_relocator32_##x##_end \
- &grub_relocator32_##x##_start)
@ -64,6 +64,9 @@ write_jump (int regn, void **target)
/* j $r. */
*(grub_uint32_t *) *target = (regn<<21) | 0x8;
*target = ((grub_uint32_t *) *target) + 1;
/* nop. */
*(grub_uint32_t *) *target = 0;
*target = ((grub_uint32_t *) *target) + 1;
}
static void

View file

@ -21,8 +21,8 @@
.p2align 4 /* force 16-byte alignment */
VARIABLE (grub_relocator32_forward_start)
move $12, $9
move $13, $10
move $a0, $9
move $a1, $10
copycont1:
lb $11,0($8)
@ -32,31 +32,13 @@ copycont1:
addiu $10, $10, 0xffff
bne $10, $0, copycont1
move $9, $12
move $10, $13
cachecont1a:
cache 1,0($12)
addiu $12, $12, 0x1
addiu $13, $13, 0xffff
bne $13, $0, cachecont1a
sync
move $12, $9
move $13, $10
cachecont1b:
cache 0,0($12)
addiu $12, $12, 0x1
addiu $13, $13, 0xffff
bne $13, $0, cachecont1b
sync
#include "../../kern/mips/cache_flush.S"
VARIABLE (grub_relocator32_forward_end)
VARIABLE (grub_relocator32_backward_start)
move $12, $9
move $13, $10
move $a0, $9
move $a1, $10
addu $9, $9, $10
addu $8, $8, $10
@ -71,23 +53,6 @@ copycont2:
addiu $10, 0xffff
bne $10, $0, copycont2
move $9, $12
move $10, $13
cachecont2a:
cache 1,0($12)
addiu $12, $12, 0x1
addiu $13, $13, 0xffff
bne $13, $0, cachecont2a
#include "../../kern/mips/cache_flush.S"
sync
move $12, $9
move $13, $10
cachecont2b:
cache 0,0($12)
addiu $12, $12, 0x1
addiu $13, $13, 0xffff
bne $13, $0, cachecont2b
sync
VARIABLE (grub_relocator32_backward_end)

65
lib/mips/setjmp.S Normal file
View file

@ -0,0 +1,65 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/symbol.h>
.file "setjmp.S"
.text
/*
* int grub_setjmp (grub_jmp_buf env)
*/
FUNCTION(grub_setjmp)
sw $s0, 0($a0)
sw $s1, 4($a0)
sw $s2, 8($a0)
sw $s3, 12($a0)
sw $s4, 16($a0)
sw $s5, 20($a0)
sw $s6, 24($a0)
sw $s7, 28($a0)
sw $s8, 32($a0)
sw $gp, 36($a0)
sw $sp, 40($a0)
sw $ra, 44($a0)
move $v0, $zero
move $v1, $zero
jr $ra
/*
* int grub_longjmp (grub_jmp_buf env, int val)
*/
FUNCTION(grub_longjmp)
lw $s0, 0($a0)
lw $s1, 4($a0)
lw $s2, 8($a0)
lw $s3, 12($a0)
lw $s4, 16($a0)
lw $s5, 20($a0)
lw $s6, 24($a0)
lw $s7, 28($a0)
lw $s8, 32($a0)
lw $gp, 36($a0)
lw $sp, 40($a0)
lw $ra, 44($a0)
move $v0, $a1
bne $v0, $zero, 1f
addiu $v0, $v0, 1
1:
move $v1, $zero
jr $ra